36 jobject& conf, jobject& executor )
37 : table_name_(table_name),
44 DCHECK(
htable_ == NULL) <<
"Must call Close()";
54 TErrorCode::GENERAL,
"HBaseTable::Close(): Error creating JNIEnv"));
72 if (env == NULL)
return Status(
"Error creating JNIEnv");
75 jstring jtable_name_string = env->NewStringUTF(
table_name_.c_str());
78 jobject jtable_name = env->CallStaticObjectMethod(
bytes_cl_,
83 jobject local_htable = env->NewObject(
htable_cl_,
95 return Status(
"Failed to get/create JVM");
104 "(Ljava/lang/String;)[B");
113 "(Lorg/apache/hadoop/conf/Configuration;"
114 "[BLjava/util/concurrent/ExecutorService;)V");
121 "(Lorg/apache/hadoop/hbase/client/Scan;)"
122 "Lorg/apache/hadoop/hbase/client/ResultScanner;");
126 "(Ljava/util/List;)V");
133 jobject* result_scanner) {
135 if (env == NULL)
return Status(
"Error creating JNIEnv");
137 (*result_scanner) = env->CallObjectMethod(
htable_,
145 if (env == NULL)
return Status(
"Error creating JNIEnv");
static jmethodID htable_put_id_
htable.put(List<Put> puts
static jmethodID htable_get_scanner_id_
htable.getScannerId(Scan)
#define RETURN_IF_ERROR(stmt)
some generally useful macros
Status Put(const jobject &puts_list)
Send an list of puts to hbase through an HTable.
static Status InitJNI()
Call this to initialize the HBase HTable jni references.
static jclass bytes_cl_
Bytes class and static methods.
HBaseTable(const std::string &table_name, jobject &conf, jobject &executor)
static Status LocalToGlobalRef(JNIEnv *env, jobject local_ref, jobject *global_ref)
void Close(RuntimeState *state)
Close and release the HTable wrapped by this class.
bool LogError(const ErrorMsg &msg)
static Status GetJniExceptionMsg(JNIEnv *env, bool log_stack=true, const std::string &prefix="")
static jmethodID htable_ctor_
new HTable(Configuration, ExecutorService)
static jmethodID bytes_to_bytes_id_
Bytes.toBytes(String)
Status push(JNIEnv *env, int max_local_ref=10)
static jclass htable_cl_
org.apache.hadoop.hbase.client.HTable
#define RETURN_ERROR_IF_EXC(env)
static Status GetGlobalClassRef(JNIEnv *env, const char *class_str, jclass *class_ref)
ImpaladQueryExecutor * executor_
execution state of coordinator fragment
const ErrorMsg & msg() const
Returns the error message associated with a non-successful status.
Status GetResultScanner(const jobject &scan, jobject *result_scanner)
static jmethodID htable_close_id_
htable.close()
JNIEnv * getJNIEnv(void)
C linkage for helper functions in hdfsJniHelper.h.