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

Public Member Functions

 Partition (RuntimeState *state, PartitionedHashJoinNode *parent, int level, bool use_small_buffers)
 
 ~Partition ()
 
BufferedTupleStreambuild_rows ()
 
BufferedTupleStreamprobe_rows ()
 
HashTablehash_tbl () const
 
bool is_closed () const
 
bool is_spilled () const
 
void Close (RowBatch *batch)
 
int64_t EstimatedInMemSize () const
 
int64_t InMemSize () const
 
template<bool const AddProbeFilters>
Status BuildHashTableInternal (RuntimeState *state, bool *built)
 
Status BuildHashTable (RuntimeState *state, bool *built, const bool add_probe_filters)
 Wrapper for the template-based BuildHashTable() based on 'add_probe_filters'. More...
 
Status Spill (bool unpin_all_build)
 

Private Attributes

PartitionedHashJoinNodeparent_
 
bool is_closed_
 
bool is_spilled_
 True if this partition is spilled. More...
 
int level_
 
boost::scoped_ptr< HashTablehash_tbl_
 The hash table for this partition. More...
 
BufferedTupleStreambuild_rows_
 
BufferedTupleStreamprobe_rows_
 

Friends

class PartitionedHashJoinNode
 

Detailed Description

Definition at line 345 of file partitioned-hash-join-node.h.

Constructor & Destructor Documentation

PartitionedHashJoinNode::Partition::Partition ( RuntimeState state,
PartitionedHashJoinNode parent,
int  level,
bool  use_small_buffers 
)

Definition at line 221 of file partitioned-hash-join-node.cc.

PartitionedHashJoinNode::Partition::~Partition ( )

Definition at line 235 of file partitioned-hash-join-node.cc.

References impala::ExecNode::is_closed().

Member Function Documentation

Status PartitionedHashJoinNode::Partition::BuildHashTable ( RuntimeState state,
bool built,
const bool  add_probe_filters 
)

Wrapper for the template-based BuildHashTable() based on 'add_probe_filters'.

Definition at line 291 of file partitioned-hash-join-node.cc.

Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), and impala::PartitionedHashJoinNode::PrepareNextPartition().

template<bool const AddProbeFilters>
Status PartitionedHashJoinNode::Partition::BuildHashTableInternal ( RuntimeState state,
bool built 
)

Pins the build tuples for this partition and constructs the hash_tbl_ from it. Build rows cannot be added after calling this. If the partition could not be built due to memory pressure, *built is set to false and the caller is responsible for spilling this partition. If 'AddProbeFilters' is set, it creates the probe filters.

Definition at line 301 of file partitioned-hash-join-node.cc.

References impala::RuntimeState::batch_size(), COUNTER_ADD, impala::HashTable::EstimateNumBuckets(), impala::RawValue::GetHashValue(), impala::hash, impala::PartitionedHashJoinNode::NUM_PARTITIONING_BITS, impala::Status::OK, RETURN_IF_ERROR, SCOPED_TIMER, impala::HashTableCtx::seed(), and UNLIKELY.

void PartitionedHashJoinNode::Partition::Close ( RowBatch batch)

Must be called once per partition to release any resources. This should be called as soon as possible to release memory. If batch is non-null, the build and probe streams are attached to the batch, transferring ownership to them.

Definition at line 248 of file partitioned-hash-join-node.cc.

References impala::RowBatch::AddTupleStream(), impala::ExecNode::is_closed(), and impala::ExecNode::is_closed_.

Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), impala::PartitionedHashJoinNode::CleanUpHashPartitions(), impala::PartitionedHashJoinNode::Close(), impala::PartitionedHashJoinNode::NextSpilledProbeRowBatch(), and impala::PartitionedHashJoinNode::OutputNullAwareNullProbe().

int64_t PartitionedHashJoinNode::Partition::EstimatedInMemSize ( ) const

Returns the estimated size of the in memory size for the build side of this partition. This includes the entire build side and the hash table.

Definition at line 239 of file partitioned-hash-join-node.cc.

References impala::HashTable::EstimateSize().

Referenced by impala::PartitionedHashJoinNode::PrepareNextPartition().

int64_t PartitionedHashJoinNode::Partition::InMemSize ( ) const

Returns the actual size of the in memory build side. Only valid to call on partitions after BuildPartition()

Definition at line 243 of file partitioned-hash-join-node.cc.

Status PartitionedHashJoinNode::Partition::Spill ( bool  unpin_all_build)

Spills this partition, cleaning up and unpinning blocks. If 'unpin_all_build' is true, the build stream is completely unpinned, otherwise, it is unpinned with one buffer remaining.

Definition at line 273 of file partitioned-hash-join-node.cc.

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

Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), and impala::PartitionedHashJoinNode::PrepareNextPartition().

Friends And Related Function Documentation

friend class PartitionedHashJoinNode
friend

Definition at line 389 of file partitioned-hash-join-node.h.

Member Data Documentation

BufferedTupleStream* impala::PartitionedHashJoinNode::Partition::build_rows_
private

Stream of build/probe tuples in this partition. Allocated from the runtime state's object pool. Initially owned by this object (meaning it has to call Close() on it) but transferred to the parent exec node (via the row batch) when the partition is complete. If NULL, ownership has been transfered.

Definition at line 413 of file partitioned-hash-join-node.h.

Referenced by build_rows(), and impala::PartitionedHashJoinNode::ProcessBuildInput().

boost::scoped_ptr<HashTable> impala::PartitionedHashJoinNode::Partition::hash_tbl_
private
bool impala::PartitionedHashJoinNode::Partition::is_closed_
private

This partition is completely processed and nothing needs to be done for it again. All resources associated with this partition are returned.

Definition at line 395 of file partitioned-hash-join-node.h.

Referenced by is_closed().

bool impala::PartitionedHashJoinNode::Partition::is_spilled_
private

True if this partition is spilled.

Definition at line 398 of file partitioned-hash-join-node.h.

Referenced by is_spilled().

int impala::PartitionedHashJoinNode::Partition::level_
private

How many times rows in this partition have been repartitioned. Partitions created from the node's children's input is level 0, 1 after the first repartitionining, etc.

Definition at line 403 of file partitioned-hash-join-node.h.

Referenced by impala::PartitionedHashJoinNode::PrepareNextPartition().

PartitionedHashJoinNode* impala::PartitionedHashJoinNode::Partition::parent_
private

Definition at line 391 of file partitioned-hash-join-node.h.

BufferedTupleStream* impala::PartitionedHashJoinNode::Partition::probe_rows_
private

Definition at line 414 of file partitioned-hash-join-node.h.

Referenced by probe_rows().


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