1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.apache.hadoop.hbase.hbql.client;
22
23 import org.apache.hadoop.hbase.HBaseConfiguration;
24 import org.apache.hadoop.hbase.hbql.impl.HConnectionImpl;
25
26 public class HConnectionManager {
27
28 private static int maxPoolReferencesPerTablePerConnection = Integer.MAX_VALUE;
29
30 public static HConnection newConnection() throws HBqlException {
31 return HConnectionManager.newConnection(null);
32 }
33
34 public static HConnection newConnection(final HBaseConfiguration config) throws HBqlException {
35 return new HConnectionImpl(config, null, getMaxPoolReferencesPerTablePerConnection());
36 }
37
38 public static int getMaxPoolReferencesPerTablePerConnection() {
39 return maxPoolReferencesPerTablePerConnection;
40 }
41
42 public static void setMaxPoolReferencesPerTablePerConnection(final int maxPoolReferencesPerTablePerConnection) {
43 HConnectionManager.maxPoolReferencesPerTablePerConnection = maxPoolReferencesPerTablePerConnection;
44 }
45 }