Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hbase-table.h
Go to the documentation of this file.
1 // Copyright 2013 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef IMPALA_RUNTIME_HBASE_HTABLE_H_
16 #define IMPALA_RUNTIME_HBASE_HTABLE_H_
17 
18 #include <boost/thread.hpp>
19 #include <jni.h>
20 #include <string>
21 
22 #include "common/status.h"
23 
24 namespace impala {
25 
26 class RuntimeState;
27 
29 class HBaseTable {
30  public:
31  HBaseTable(const std::string& table_name, jobject& conf, jobject& executor);
32  ~HBaseTable();
33 
35  void Close(RuntimeState* state);
36 
39  Status Init();
40 
43  Status GetResultScanner(const jobject& scan, jobject* result_scanner);
44 
46  Status Put(const jobject& puts_list);
47 
49  static Status InitJNI();
50 
51  private:
52  std::string table_name_;
53  jobject conf_;
54  jobject executor_;
55  jobject htable_;
56 
58  static jclass htable_cl_;
59 
61  static jmethodID htable_ctor_;
62 
64  static jmethodID htable_close_id_;
65 
67  static jmethodID htable_get_scanner_id_;
68 
70  static jmethodID htable_put_id_;
71 
73  static jclass bytes_cl_;
74 
76  static jmethodID bytes_to_bytes_id_;
77 };
78 
79 } // namespace impala
80 #endif /* IMPALA_RUNTIME_HBASE_HTABLE_H_ */
static jmethodID htable_put_id_
htable.put(List<Put> puts
Definition: hbase-table.h:70
static jmethodID htable_get_scanner_id_
htable.getScannerId(Scan)
Definition: hbase-table.h:67
Status Put(const jobject &puts_list)
Send an list of puts to hbase through an HTable.
Definition: hbase-table.cc:143
static Status InitJNI()
Call this to initialize the HBase HTable jni references.
Definition: hbase-table.cc:92
static jclass bytes_cl_
Bytes class and static methods.
Definition: hbase-table.h:73
HBaseTable(const std::string &table_name, jobject &conf, jobject &executor)
Class to wrap JNI calls into HTable.
Definition: hbase-table.h:29
void Close(RuntimeState *state)
Close and release the HTable wrapped by this class.
Definition: hbase-table.cc:47
std::string table_name_
Definition: hbase-table.h:52
static jmethodID htable_ctor_
new HTable(Configuration, ExecutorService)
Definition: hbase-table.h:61
static jmethodID bytes_to_bytes_id_
Bytes.toBytes(String)
Definition: hbase-table.h:76
static jclass htable_cl_
org.apache.hadoop.hbase.client.HTable
Definition: hbase-table.h:58
Status GetResultScanner(const jobject &scan, jobject *result_scanner)
Definition: hbase-table.cc:132
static jmethodID htable_close_id_
htable.close()
Definition: hbase-table.h:64