Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <hbase-table-sink.h>
Public Member Functions | |
HBaseTableSink (const RowDescriptor &row_desc, const std::vector< TExpr > &select_list_texprs, const TDataSink &tsink) | |
virtual Status | Prepare (RuntimeState *state) |
virtual Status | Open (RuntimeState *state) |
Call before Send() or Close(). More... | |
virtual Status | Send (RuntimeState *state, RowBatch *batch, bool eos) |
virtual void | Close (RuntimeState *state) |
virtual RuntimeProfile * | profile () |
Returns the runtime profile for the sink. More... | |
Static Public Member Functions | |
static Status | CreateDataSink (ObjectPool *pool, const TDataSink &thrift_sink, const std::vector< TExpr > &output_exprs, const TPlanFragmentExecParams ¶ms, const RowDescriptor &row_desc, boost::scoped_ptr< DataSink > *sink) |
static void | MergeInsertStats (const TInsertStats &src_stats, TInsertStats *dst_stats) |
static std::string | OutputInsertStats (const PartitionStatusMap &stats, const std::string &prefix="") |
Outputs the insert stats contained in the map of insert partition updates to a string. More... | |
Protected Attributes | |
bool | closed_ |
boost::scoped_ptr< MemTracker > | expr_mem_tracker_ |
Private Member Functions | |
Status | PrepareExprs (RuntimeState *state) |
Turn thrift TExpr into Expr and prepare them to run. More... | |
Private Attributes | |
TableId | table_id_ |
Used to get the HBaseTableDescriptor from the RuntimeState. More... | |
HBaseTableDescriptor * | table_desc_ |
The description of the table. Used for table name and column mapping. More... | |
boost::scoped_ptr < HBaseTableWriter > | hbase_table_writer_ |
const RowDescriptor & | row_desc_ |
Owned by the RuntimeState. More... | |
const std::vector< TExpr > & | select_list_texprs_ |
Owned by the RuntimeState. More... | |
std::vector< ExprContext * > | output_expr_ctxs_ |
RuntimeProfile * | runtime_profile_ |
Allocated from runtime state's pool. More... | |
Class to take row batches and send them to the HBaseTableWriter to eventually be written into an HBase table.
Definition at line 33 of file hbase-table-sink.h.
impala::HBaseTableSink::HBaseTableSink | ( | const RowDescriptor & | row_desc, |
const std::vector< TExpr > & | select_list_texprs, | ||
const TDataSink & | tsink | ||
) |
|
virtual |
Releases all resources that were allocated in Prepare()/Send(). Further Send() calls are illegal after calling Close(). It must be okay to call this multiple times. Subsequent calls should be ignored.
Implements impala::DataSink.
Definition at line 95 of file hbase-table-sink.cc.
References SCOPED_TIMER.
|
staticinherited |
Creates a new data sink from thrift_sink. A pointer to the new sink is written to *sink, and is owned by the caller.
Definition at line 34 of file data-sink.cc.
References impala::Status::OK.
Referenced by impala::PlanFragmentExecutor::Prepare().
|
staticinherited |
Merges one update to the insert stats for a partition. dst_stats will have the combined stats of src_stats and dst_stats after this method returns.
Definition at line 90 of file data-sink.cc.
Referenced by impala::HdfsTableSink::FinalizePartitionFile().
|
virtual |
Call before Send() or Close().
Implements impala::DataSink.
Definition at line 80 of file hbase-table-sink.cc.
|
staticinherited |
Outputs the insert stats contained in the map of insert partition updates to a string.
Definition at line 103 of file data-sink.cc.
References impala::PrettyPrinter::Print().
|
virtual |
Setup. Call before Send(), Open(), or Close(). Subclasses must call DataSink::Prepare().
Reimplemented from impala::DataSink.
Definition at line 51 of file hbase-table-sink.cc.
References impala::ObjectPool::Add(), impala::RuntimeState::desc_tbl(), impala::DescriptorTbl::GetTableDescriptor(), impala::RuntimeState::obj_pool(), impala::OK, impala::RuntimeState::per_partition_status(), RETURN_IF_ERROR, impala::ROOT_PARTITION_KEY, and SCOPED_TIMER.
|
private |
Turn thrift TExpr into Expr and prepare them to run.
Definition at line 41 of file hbase-table-sink.cc.
References impala::RuntimeState::obj_pool(), impala::OK, RETURN_IF_ERROR, and impala::row_desc_.
|
inlinevirtual |
Returns the runtime profile for the sink.
Implements impala::DataSink.
Definition at line 42 of file hbase-table-sink.h.
References runtime_profile_.
|
virtual |
Send a row batch into this sink. eos should be true when the last batch is passed to Send()
Implements impala::DataSink.
Definition at line 84 of file hbase-table-sink.cc.
References impala::RuntimeState::CheckQueryState(), impala::RowBatch::num_rows(), impala::OK, impala::RuntimeState::per_partition_status(), RETURN_IF_ERROR, impala::ROOT_PARTITION_KEY, and SCOPED_TIMER.
|
protectedinherited |
Set to true after Close() has been called. Subclasses should check and set this in Close().
Definition at line 83 of file data-sink.h.
Referenced by impala::HdfsTableSink::Close().
|
protectedinherited |
Definition at line 85 of file data-sink.h.
Referenced by impala::DataSink::Prepare(), and impala::HdfsTableSink::PrepareExprs().
|
private |
The object that this sink uses to write to hbase. hbase_table_writer is owned by this sink and should be closed when this is Close'd.
Definition at line 57 of file hbase-table-sink.h.
|
private |
Definition at line 64 of file hbase-table-sink.h.
|
private |
Owned by the RuntimeState.
Definition at line 60 of file hbase-table-sink.h.
|
private |
Allocated from runtime state's pool.
Definition at line 67 of file hbase-table-sink.h.
Referenced by profile().
|
private |
Owned by the RuntimeState.
Definition at line 63 of file hbase-table-sink.h.
|
private |
The description of the table. Used for table name and column mapping.
Definition at line 52 of file hbase-table-sink.h.
|
private |
Used to get the HBaseTableDescriptor from the RuntimeState.
Definition at line 49 of file hbase-table-sink.h.