Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Superclass of all data sinks. More...
#include <data-sink.h>
Public Member Functions | |
DataSink () | |
virtual | ~DataSink () |
virtual Status | Prepare (RuntimeState *state) |
virtual Status | Open (RuntimeState *state)=0 |
Call before Send() or Close(). More... | |
virtual Status | Send (RuntimeState *state, RowBatch *batch, bool eos)=0 |
virtual void | Close (RuntimeState *state)=0 |
virtual RuntimeProfile * | profile ()=0 |
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_ |
Superclass of all data sinks.
Definition at line 39 of file data-sink.h.
|
inline |
Definition at line 41 of file data-sink.h.
|
inlinevirtual |
Definition at line 42 of file data-sink.h.
|
pure 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.
Implemented in impala::HdfsTableSink, impala::DataStreamSender, and impala::HBaseTableSink.
|
static |
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().
|
static |
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().
|
pure virtual |
Call before Send() or Close().
Implemented in impala::HdfsTableSink, impala::DataStreamSender, and impala::HBaseTableSink.
|
static |
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 in impala::HdfsTableSink, impala::DataStreamSender, and impala::HBaseTableSink.
Definition at line 136 of file data-sink.cc.
References expr_mem_tracker_, impala::RuntimeState::instance_mem_tracker(), and impala::Status::OK.
Referenced by impala::HdfsTableSink::Prepare().
|
pure virtual |
Returns the runtime profile for the sink.
Implemented in impala::HdfsTableSink, impala::DataStreamSender, and impala::HBaseTableSink.
|
pure virtual |
Send a row batch into this sink. eos should be true when the last batch is passed to Send()
Implemented in impala::HdfsTableSink, impala::DataStreamSender, and impala::HBaseTableSink.
|
protected |
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().
|
protected |
Definition at line 85 of file data-sink.h.
Referenced by Prepare(), and impala::HdfsTableSink::PrepareExprs().