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

Classes

struct  BuildPartition
 
struct  Partition
 

Public Member Functions

 DataPartitioner (MemPool *pool, RuntimeProfile *profile, int size, int hash_offset)
 
void AddData (int n, uint8_t *data)
 
int size_per_block () const
 
int NumTuples (const Partition &partition) const
 
int NumTuples (const Partition &partition, int block_idx) const
 
bool Finalize (vector< Partition > *results)
 

Private Member Functions

uint8_t * Allocate (BuildPartition *partition, int p, int size=0)
 
Partition ToOutputPartition (const BuildPartition &build) const
 
int TotalTuples (const BuildPartition &partition) const
 
int NumLastBlock (int p) const
 
int NumTuples (const BuildPartition &partition, int block_idx) const
 
bool Split (const BuildPartition &build_partition)
 

Private Attributes

MemPoolpool_
 
RuntimeProfileprofile_
 
RuntimeProfile::Counterbytes_allocated_
 
RuntimeProfile::Counterbytes_copied_
 
RuntimeProfile::Countersplit_time_
 
RuntimeProfile::Counteradd_time_
 
RuntimeProfile::Countersplits_
 
int size_
 
int hash_offset_
 
int tuples_per_partition_
 
int partitions_per_level_
 
int partition_idx_mask_
 
vector< PointerValueoutputs_
 
vector< int32_t > split_counts_
 
vector< int > partitions_at_level_
 
vector< BuildPartitionbuild_partitions_
 
vector< BuildPartitionchild_partitions_
 

Static Private Attributes

static const int L1_size = 24 * 1024
 
static const int MIN_SPLITS = 4
 
static const int HASH_BIT_SHIFT = 4
 

Detailed Description

Definition at line 91 of file tuple-splitter-test.cc.

Constructor & Destructor Documentation

DataPartitioner::DataPartitioner ( MemPool pool,
RuntimeProfile profile,
int  size,
int  hash_offset 
)
inline

Definition at line 93 of file tuple-splitter-test.cc.

References ADD_COUNTER, NextPowerOfTwo(), and pool.

Member Function Documentation

void DataPartitioner::AddData ( int  n,
uint8_t *  data 
)

Definition at line 251 of file tuple-splitter-test.cc.

References COUNTER_ADD, impala::hash, Memcpy16(), and SCOPED_TIMER.

uint8_t* DataPartitioner::Allocate ( BuildPartition partition,
int  p,
int  size = 0 
)
inlineprivate

Definition at line 221 of file tuple-splitter-test.cc.

References DataPartitioner::BuildPartition::blocks, and COUNTER_ADD.

bool DataPartitioner::Finalize ( vector< Partition > *  results)
inline
int DataPartitioner::NumLastBlock ( int  p) const
inlineprivate

Definition at line 239 of file tuple-splitter-test.cc.

int DataPartitioner::NumTuples ( const Partition partition) const
inline
int DataPartitioner::NumTuples ( const Partition partition,
int  block_idx 
) const
inline
int DataPartitioner::NumTuples ( const BuildPartition partition,
int  block_idx 
) const
inlineprivate
int DataPartitioner::size_per_block ( ) const
inline

Definition at line 139 of file tuple-splitter-test.cc.

Partition DataPartitioner::ToOutputPartition ( const BuildPartition build) const
inlineprivate
int DataPartitioner::TotalTuples ( const BuildPartition partition) const
inlineprivate

Member Data Documentation

RuntimeProfile::Counter* DataPartitioner::add_time_
private

Definition at line 201 of file tuple-splitter-test.cc.

vector<BuildPartition> DataPartitioner::build_partitions_
private

Definition at line 218 of file tuple-splitter-test.cc.

RuntimeProfile::Counter* DataPartitioner::bytes_allocated_
private

Definition at line 198 of file tuple-splitter-test.cc.

RuntimeProfile::Counter* DataPartitioner::bytes_copied_
private

Definition at line 199 of file tuple-splitter-test.cc.

vector<BuildPartition> DataPartitioner::child_partitions_
private

Definition at line 219 of file tuple-splitter-test.cc.

const int DataPartitioner::HASH_BIT_SHIFT = 4
staticprivate

Definition at line 195 of file tuple-splitter-test.cc.

int DataPartitioner::hash_offset_
private

Definition at line 205 of file tuple-splitter-test.cc.

const int DataPartitioner::L1_size = 24 * 1024
staticprivate

Definition at line 193 of file tuple-splitter-test.cc.

const int DataPartitioner::MIN_SPLITS = 4
staticprivate

Definition at line 194 of file tuple-splitter-test.cc.

vector<PointerValue> DataPartitioner::outputs_
private

Definition at line 209 of file tuple-splitter-test.cc.

int DataPartitioner::partition_idx_mask_
private

Definition at line 208 of file tuple-splitter-test.cc.

vector<int> DataPartitioner::partitions_at_level_
private

Definition at line 211 of file tuple-splitter-test.cc.

int DataPartitioner::partitions_per_level_
private

Definition at line 207 of file tuple-splitter-test.cc.

MemPool* DataPartitioner::pool_
private

Definition at line 196 of file tuple-splitter-test.cc.

RuntimeProfile* DataPartitioner::profile_
private

Definition at line 197 of file tuple-splitter-test.cc.

int DataPartitioner::size_
private

Definition at line 204 of file tuple-splitter-test.cc.

vector<int32_t> DataPartitioner::split_counts_
private

Definition at line 210 of file tuple-splitter-test.cc.

RuntimeProfile::Counter* DataPartitioner::split_time_
private

Definition at line 200 of file tuple-splitter-test.cc.

RuntimeProfile::Counter* DataPartitioner::splits_
private

Definition at line 202 of file tuple-splitter-test.cc.

int DataPartitioner::tuples_per_partition_
private

Definition at line 206 of file tuple-splitter-test.cc.


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