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.HTableDescriptor;
25
26 import java.util.List;
27 import java.util.Set;
28
29 public interface HConnection {
30
31 HBaseConfiguration getHBaseConfiguration();
32
33
34
35 Set<String> getFamilyNames(String tableName) throws HBqlException;
36
37 void close();
38
39 boolean isClosed() throws HBqlException;
40
41 boolean isPooled();
42
43
44 boolean tableExists(String tableName) throws HBqlException;
45
46 HTableDescriptor getHTableDescriptor(String tableName) throws HBqlException;
47
48 boolean tableEnabled(String tableName) throws HBqlException;
49
50 void dropTable(String tableName) throws HBqlException;
51
52 void disableTable(String tableName) throws HBqlException;
53
54 void enableTable(String tableName) throws HBqlException;
55
56 Set<String> getTableNames() throws HBqlException;
57
58
59 boolean indexExistsForMapping(final String indexName, final String mappingName) throws HBqlException;
60
61 void dropIndexForMapping(final String indexName, final String mappingName) throws HBqlException;
62
63 boolean indexExistsForTable(final String indexName, final String tableName) throws HBqlException;
64
65 void dropIndexForTable(final String tableName, final String indexName) throws HBqlException;
66
67
68 HStatement createStatement() throws HBqlException;
69
70 HPreparedStatement prepareStatement(String str) throws HBqlException;
71
72
73 ExecutionResults execute(String sql) throws HBqlException;
74
75 HResultSet<HRecord> executeQuery(String sql) throws HBqlException;
76
77 <T> HResultSet<T> executeQuery(String sql, Class clazz) throws HBqlException;
78
79 List<HRecord> executeQueryAndFetch(String sql) throws HBqlException;
80
81 <T> List<T> executeQueryAndFetch(String sql, Class clazz) throws HBqlException;
82
83 ExecutionResults executeUpdate(String sql) throws HBqlException;
84
85
86 HMapping getMapping(String mappingName) throws HBqlException;
87
88 boolean mappingExists(String mappingName) throws HBqlException;
89
90 boolean dropMapping(String mappingName) throws HBqlException;
91
92 Set<HMapping> getAllMappings() throws HBqlException;
93
94
95 void setQueryExecutorPoolName(String name);
96
97 String getQueryExecutorPoolName();
98
99
100 void setAsyncExecutorName(String name);
101
102 String getAsyncExecutorName();
103
104 <T> HBatch<T> newHBatch();
105 }