Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::HBaseTableFactory Class Reference

#include <hbase-table-factory.h>

Collaboration diagram for impala::HBaseTableFactory:

Public Member Functions

 ~HBaseTableFactory ()
 
Status GetTable (const std::string &table_name, boost::scoped_ptr< HBaseTable > *hbase_table)
 

Static Public Member Functions

static Status Init ()
 

Static Private Attributes

static jclass executor_cl_ = NULL
 ExecutorService class and methods. More...
 
static jmethodID executor_shutdown_id_ = NULL
 
static jobject conf_ = NULL
 Configuration and executor jobject's. Initialized in Init(). More...
 
static jobject executor_ = NULL
 

Detailed Description

A (process-wide) factory of HTable java objects. This object keeps java objects around to ease creation of HTables that share a pool of threads and connections. TODO: Consider writing factory in Java to save JNI logic (and to avoid having to mark objects as global refs) TODO: Implement a cache to avoid creating more HTables than necessary TODO: Add metrics to track the number of tables outstanding

Definition at line 34 of file hbase-table-factory.h.

Constructor & Destructor Documentation

impala::HBaseTableFactory::~HBaseTableFactory ( )

Definition at line 93 of file hbase-table-factory.cc.

References conf_, executor_, executor_shutdown_id_, and getJNIEnv().

Member Function Documentation

Status impala::HBaseTableFactory::GetTable ( const std::string &  table_name,
boost::scoped_ptr< HBaseTable > *  hbase_table 
)

create an HTable java object for the given table name. The new htable is returned in global_htable It is the caller's responsibility to close the HBaseTable using HBaseTable::Close().

Definition at line 107 of file hbase-table-factory.cc.

References conf_, executor_, impala::Status::OK, and RETURN_IF_ERROR.

Referenced by impala::HBaseTableWriter::Init(), and impala::HBaseTableScanner::ScanSetup().

Status impala::HBaseTableFactory::Init ( )
static

JNI setup. Create global references to classes, and find method ids.

Definition at line 32 of file hbase-table-factory.cc.

References conf_, executor_, executor_cl_, executor_shutdown_id_, getJNIEnv(), impala::HBaseTable::InitJNI(), impala::JniUtil::LocalToGlobalRef(), impala::Status::OK, RETURN_ERROR_IF_EXC, and RETURN_IF_ERROR.

Referenced by main().

Member Data Documentation

jobject impala::HBaseTableFactory::conf_ = NULL
staticprivate

Configuration and executor jobject's. Initialized in Init().

Definition at line 55 of file hbase-table-factory.h.

Referenced by GetTable(), Init(), and ~HBaseTableFactory().

jobject impala::HBaseTableFactory::executor_ = NULL
staticprivate

Definition at line 56 of file hbase-table-factory.h.

Referenced by GetTable(), Init(), and ~HBaseTableFactory().

jclass impala::HBaseTableFactory::executor_cl_ = NULL
staticprivate

ExecutorService class and methods.

Definition at line 51 of file hbase-table-factory.h.

Referenced by Init().

jmethodID impala::HBaseTableFactory::executor_shutdown_id_ = NULL
staticprivate

Definition at line 52 of file hbase-table-factory.h.

Referenced by Init(), and ~HBaseTableFactory().


The documentation for this class was generated from the following files: