Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::Sorter::Run Class Reference
Collaboration diagram for impala::Sorter::Run:

Public Member Functions

 Run (Sorter *parent, TupleDescriptor *sort_tuple_desc, bool materialize_slots)
 
Status Init ()
 
template<bool has_var_len_data>
Status AddBatch (RowBatch *batch, int start_index, int *num_processed)
 
Status UnpinAllBlocks ()
 
void DeleteAllBlocks ()
 
Status GetNextBatch (RowBatch **sorted_batch)
 

Private Member Functions

template<bool convert_offset_to_ptr>
Status GetNext (RowBatch *output_batch, bool *eos)
 
bool CanExtendRun () const
 
void CollectNonNullVarSlots (Tuple *src, vector< StringValue * > *var_len_values, int *total_var_len)
 
Status TryAddBlock (vector< BufferedBlockMgr::Block * > *block_sequence, bool *added)
 
Status PrepareRead ()
 
void CopyVarLenData (char *dest, const vector< StringValue * > &var_values)
 
void CopyVarLenDataConvertOffset (char *dest, int64_t offset, const vector< StringValue * > &var_values)
 

Private Attributes

const Sortersorter_
 
const TupleDescriptorsort_tuple_desc_
 
const int sort_tuple_size_
 
const int block_size_
 
const bool has_var_len_slots_
 
const bool materialize_slots_
 
bool is_sorted_
 
bool is_pinned_
 
vector< BufferedBlockMgr::Block * > fixed_len_blocks_
 
vector< BufferedBlockMgr::Block * > var_len_blocks_
 
BufferedBlockMgr::Blockvar_len_copy_block_
 
int64_t num_tuples_
 
int64_t num_tuples_returned_
 
scoped_ptr< RowBatchbuffered_batch_
 
int fixed_len_blocks_index_
 
int var_len_blocks_index_
 
bool pin_next_fixed_len_block_
 
bool pin_next_var_len_block_
 
int fixed_len_block_offset_
 

Friends

class Sorter
 
class TupleSorter
 

Detailed Description

Definition at line 45 of file sorter.cc.

Constructor & Destructor Documentation

impala::Sorter::Run::Run ( Sorter parent,
TupleDescriptor sort_tuple_desc,
bool  materialize_slots 
)

Definition at line 336 of file sorter.cc.

Member Function Documentation

bool impala::Sorter::Run::CanExtendRun ( ) const
private
void impala::Sorter::Run::CollectNonNullVarSlots ( Tuple src,
vector< StringValue * > *  var_len_values,
int *  total_var_len 
)
private
void impala::Sorter::Run::CopyVarLenData ( char *  dest,
const vector< StringValue * > &  var_values 
)
private

Definition at line 739 of file sorter.cc.

References impala::StringValue::len, and impala::StringValue::ptr.

void impala::Sorter::Run::CopyVarLenDataConvertOffset ( char *  dest,
int64_t  offset,
const vector< StringValue * > &  var_values 
)
private

Definition at line 747 of file sorter.cc.

References impala::StringValue::len, offset, and impala::StringValue::ptr.

void impala::Sorter::Run::DeleteAllBlocks ( )

Definition at line 468 of file sorter.cc.

References impala::BufferedBlockMgr::Block::Delete().

Referenced by impala::Sorter::~Sorter().

Status impala::Sorter::Run::GetNextBatch ( RowBatch **  sorted_batch)
Status impala::Sorter::Run::Init ( )

Definition at line 350 of file sorter.cc.

References impala::Sorter::has_var_len_slots_, impala::Status::OK, and RETURN_IF_ERROR.

Referenced by impala::Sorter::Init().

Status impala::Sorter::Run::TryAddBlock ( vector< BufferedBlockMgr::Block * > *  block_sequence,
bool added 
)
private

Definition at line 716 of file sorter.cc.

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

Friends And Related Function Documentation

friend class Sorter
friend

Definition at line 80 of file sorter.cc.

friend class TupleSorter
friend

Definition at line 81 of file sorter.cc.

Member Data Documentation

const int impala::Sorter::Run::block_size_
private

Definition at line 139 of file sorter.cc.

scoped_ptr<RowBatch> impala::Sorter::Run::buffered_batch_
private

Definition at line 180 of file sorter.cc.

int impala::Sorter::Run::fixed_len_block_offset_
private

Definition at line 195 of file sorter.cc.

vector<BufferedBlockMgr::Block*> impala::Sorter::Run::fixed_len_blocks_
private
int impala::Sorter::Run::fixed_len_blocks_index_
private

Definition at line 185 of file sorter.cc.

const bool impala::Sorter::Run::has_var_len_slots_
private

Definition at line 141 of file sorter.cc.

bool impala::Sorter::Run::is_pinned_
private

Definition at line 153 of file sorter.cc.

bool impala::Sorter::Run::is_sorted_
private

Definition at line 150 of file sorter.cc.

Referenced by impala::Sorter::TupleSorter::Sort().

const bool impala::Sorter::Run::materialize_slots_
private

Definition at line 146 of file sorter.cc.

int64_t impala::Sorter::Run::num_tuples_
private

Definition at line 173 of file sorter.cc.

int64_t impala::Sorter::Run::num_tuples_returned_
private

Definition at line 176 of file sorter.cc.

bool impala::Sorter::Run::pin_next_fixed_len_block_
private

Definition at line 191 of file sorter.cc.

bool impala::Sorter::Run::pin_next_var_len_block_
private

Definition at line 192 of file sorter.cc.

const TupleDescriptor* impala::Sorter::Run::sort_tuple_desc_
private

Definition at line 135 of file sorter.cc.

const int impala::Sorter::Run::sort_tuple_size_
private

Definition at line 138 of file sorter.cc.

const Sorter* impala::Sorter::Run::sorter_
private

Definition at line 131 of file sorter.cc.

vector<BufferedBlockMgr::Block*> impala::Sorter::Run::var_len_blocks_
private

Definition at line 165 of file sorter.cc.

Referenced by impala::Sorter::SortRun().

int impala::Sorter::Run::var_len_blocks_index_
private

Definition at line 186 of file sorter.cc.

BufferedBlockMgr::Block* impala::Sorter::Run::var_len_copy_block_
private

Definition at line 170 of file sorter.cc.

Referenced by impala::Sorter::SortRun().


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