36 return Status(
"Failed to get/create JVM");
42 jclass hbase_conf_cl =
43 env->FindClass(
"org/apache/hadoop/hbase/HBaseConfiguration");
46 jmethodID hbase_conf_create_id =
47 env->GetStaticMethodID(hbase_conf_cl,
"create",
48 "()Lorg/apache/hadoop/conf/Configuration;");
52 env->CallStaticObjectMethod(hbase_conf_cl, hbase_conf_create_id);
55 env->DeleteLocalRef(local_conf);
62 jclass executors_cl = env->FindClass(
"java/util/concurrent/Executors");
65 jmethodID executors_cached_thread = env->GetStaticMethodID(executors_cl,
66 "newCachedThreadPool",
"()Ljava/util/concurrent/ExecutorService;");
70 jobject local_executor =
71 env->CallStaticObjectMethod(executors_cl, executors_cached_thread);
78 env->DeleteLocalRef(local_executor);
82 executor_cl_ = env->FindClass(
"java/util/concurrent/ExecutorService");
86 "()Ljava/util/List;");
98 env->DeleteGlobalRef(
conf_);
108 scoped_ptr<HBaseTable>* hbase_table) {
#define RETURN_IF_ERROR(stmt)
some generally useful macros
static Status InitJNI()
Call this to initialize the HBase HTable jni references.
static jmethodID executor_shutdown_id_
Status GetTable(const std::string &table_name, boost::scoped_ptr< HBaseTable > *hbase_table)
Class to wrap JNI calls into HTable.
static jobject conf_
Configuration and executor jobject's. Initialized in Init().
static Status LocalToGlobalRef(JNIEnv *env, jobject local_ref, jobject *global_ref)
#define RETURN_ERROR_IF_EXC(env)
static jclass executor_cl_
ExecutorService class and methods.
JNIEnv * getJNIEnv(void)
C linkage for helper functions in hdfsJniHelper.h.