15 #ifndef IMPALA_EXEC_HBASE_TABLE_SCANNER_H
16 #define IMPALA_EXEC_HBASE_TABLE_SCANNER_H
18 #include <boost/scoped_ptr.hpp>
23 #include "gen-cpp/PlanNodes_types.h"
30 class TupleDescriptor;
94 void DebugString(
int indentation_level, std::stringstream* out);
108 const std::vector<THBaseFilter>& filters);
125 Status GetValue(JNIEnv* env,
const std::string& family,
const std::string& qualifier,
126 void** value,
int* value_length);
132 Status GetValue(JNIEnv* env,
const std::string& family,
const std::string& qualifier,
136 void Close(JNIEnv* env);
265 const std::vector<THBaseFilter>& filters);
274 inline void GetRowKey(JNIEnv* env, jobject cell,
void** data,
int* length);
278 inline void GetFamily(JNIEnv* env, jobject cell,
void** data,
int* length);
282 inline void GetQualifier(JNIEnv* env, jobject cell,
void** data,
int* length);
285 inline void GetValue(JNIEnv* env, jobject cell,
void** data,
int* length);
291 const std::string& qualifier,
void** data,
int* length,
bool* is_null);
static jmethodID cell_get_row_length_id_
const std::string & start_key() const
static jmethodID resultscanner_next_id_
static jmethodID cell_get_qualifier_array_
Status StartScan(JNIEnv *env, const TupleDescriptor *tuple_desc, const ScanRangeVector &scan_range_vector, const std::vector< THBaseFilter > &filters)
HBaseTableFactory * htable_factory_
HBase Table factory from runtime state.
static jmethodID scan_set_cache_blocks_id_
Status ScanSetup(JNIEnv *env, const TupleDescriptor *tuple_desc, const std::vector< THBaseFilter > &filters)
First time scanning the table, do some setup.
static jmethodID scan_set_filter_id_
void WriteTupleSlot(const SlotDescriptor *slot_desc, Tuple *tuple, void *data)
static jclass single_column_value_filter_cl_
static jmethodID cell_get_row_offset_id_
A tuple with 0 materialised slots is represented as NULL.
Status Next(JNIEnv *env, bool *has_next)
static jmethodID cell_get_value_array_
Status GetCurrentValue(JNIEnv *env, const std::string &family, const std::string &qualifier, void **data, int *length, bool *is_null)
void set_stop_key(const std::string &key)
static jmethodID cell_get_row_array_
int CompareStrings(const std::string &s, void *data, int length)
static jmethodID scan_set_start_row_id_
static jmethodID single_column_value_filter_ctor_
static jmethodID scan_add_column_id_
static jobject empty_row_
static jobject must_pass_all_op_
Status GetRowKey(JNIEnv *env, void **key, int *key_length)
Get the current HBase row key.
static jmethodID cell_get_value_length_id_
void Close(JNIEnv *env)
Close HTable and ResultScanner.
static jclass scan_cl_
Global class references created with JniUtil. Cleanup is done in JniUtil::Cleanup().
int current_scan_range_idx_
const ScanRangeVector * scan_range_vector_
Vector of ScanRange.
boost::scoped_ptr< HBaseTable > htable_
C++ wrapper for HTable.
static jmethodID result_raw_cells_id_
HBaseTableScanner(HBaseScanNode *scan_node, HBaseTableFactory *htable_factory, RuntimeState *state)
static jclass resultscanner_cl_
static jmethodID scan_set_caching_id_
static jmethodID scan_set_stop_row_id_
void set_num_requested_cells(int num_requested_cells)
Status HandleResultScannerTimeout(JNIEnv *env, bool *timeout)
Status InitScanRange(JNIEnv *env, const ScanRange &scan_range)
Initialize the scan to the given range.
int num_addl_requested_cols_
static jmethodID cell_get_family_offset_id_
static jmethodID filter_list_add_filter_id_
Status GetValue(JNIEnv *env, const std::string &family, const std::string &qualifier, void **value, int *value_length)
HBaseScanNode * scan_node_
The enclosing HBaseScanNode.
static jmethodID result_isempty_id_
static jmethodID cell_get_value_offset_id_
static jclass hconstants_cl_
static jmethodID cell_get_qualifier_offset_id_
void set_start_key(const std::string &key)
static jmethodID filter_list_ctor_
const std::string & stop_key() const
static jclass filter_list_op_cl_
static jmethodID cell_get_qualifier_length_id_
static jmethodID cell_get_family_length_id_
static jclass compare_op_cl_
static jmethodID scan_ctor_
int cell_index_
Current position in cells_. Incremented in NextValue(). Reset in Next().
int num_cells_
Number of cells returned from last result_.raw().
std::vector< ScanRange > ScanRangeVector
static jmethodID scan_set_max_versions_id_
static jmethodID resultscanner_close_id_
Status CreateByteArray(JNIEnv *env, const std::string &s, jbyteArray *bytes)
Turn strings into Java byte array.
static const int DEFAULT_ROWS_CACHED
bool cache_blocks_
True if the scanner should set Scan.setCacheBlocks to true.
void GetFamily(JNIEnv *env, jobject cell, void **data, int *length)
static jobjectArray compare_ops_
static jmethodID cell_get_family_array_
HBase scan range; "" means unbounded.
void DebugString(int indentation_level, std::stringstream *out)
Write debug string of this ScanRange into out.
boost::scoped_ptr< MemPool > value_pool_
void GetQualifier(JNIEnv *env, jobject cell, void **data, int *length)
RuntimeProfile::Counter * scan_setup_timer_
HBase specific counters.
static jclass cell_cl_
Cell or KeyValue class depending on HBase version (see class comment).
static jclass scanner_timeout_ex_cl_
Exception thrown when a ResultScanner times out.
static jclass filter_list_cl_