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

Superclass of all data sinks. More...

#include <data-sink.h>

Inheritance diagram for impala::DataSink:
Collaboration diagram for impala::DataSink:

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 RuntimeProfileprofile ()=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 &params, 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< MemTrackerexpr_mem_tracker_
 

Detailed Description

Superclass of all data sinks.

Definition at line 39 of file data-sink.h.

Constructor & Destructor Documentation

impala::DataSink::DataSink ( )
inline

Definition at line 41 of file data-sink.h.

virtual impala::DataSink::~DataSink ( )
inlinevirtual

Definition at line 42 of file data-sink.h.

Member Function Documentation

virtual void impala::DataSink::Close ( RuntimeState state)
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.

Status impala::DataSink::CreateDataSink ( ObjectPool pool,
const TDataSink &  thrift_sink,
const std::vector< TExpr > &  output_exprs,
const TPlanFragmentExecParams &  params,
const RowDescriptor row_desc,
boost::scoped_ptr< DataSink > *  sink 
)
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().

void impala::DataSink::MergeInsertStats ( const TInsertStats &  src_stats,
TInsertStats *  dst_stats 
)
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().

virtual Status impala::DataSink::Open ( RuntimeState state)
pure virtual
string impala::DataSink::OutputInsertStats ( const PartitionStatusMap stats,
const std::string &  prefix = "" 
)
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().

Status impala::DataSink::Prepare ( RuntimeState state)
virtual
virtual RuntimeProfile* impala::DataSink::profile ( )
pure virtual

Returns the runtime profile for the sink.

Implemented in impala::HdfsTableSink, impala::DataStreamSender, and impala::HBaseTableSink.

virtual Status impala::DataSink::Send ( RuntimeState state,
RowBatch batch,
bool  eos 
)
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.

Member Data Documentation

bool impala::DataSink::closed_
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().

boost::scoped_ptr<MemTracker> impala::DataSink::expr_mem_tracker_
protected

Definition at line 85 of file data-sink.h.

Referenced by Prepare(), and impala::HdfsTableSink::PrepareExprs().


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