Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Public Member Functions | |
Partition (RuntimeState *state, PartitionedHashJoinNode *parent, int level, bool use_small_buffers) | |
~Partition () | |
BufferedTupleStream * | build_rows () |
BufferedTupleStream * | probe_rows () |
HashTable * | hash_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 | |
PartitionedHashJoinNode * | parent_ |
bool | is_closed_ |
bool | is_spilled_ |
True if this partition is spilled. More... | |
int | level_ |
boost::scoped_ptr< HashTable > | hash_tbl_ |
The hash table for this partition. More... | |
BufferedTupleStream * | build_rows_ |
BufferedTupleStream * | probe_rows_ |
Friends | |
class | PartitionedHashJoinNode |
Definition at line 345 of file partitioned-hash-join-node.h.
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().
|
inline |
Definition at line 351 of file partitioned-hash-join-node.h.
References build_rows_.
Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), impala::PartitionedHashJoinNode::CleanUpHashPartitions(), impala::PartitionedHashJoinNode::LargestSpilledPartition(), impala::PartitionedHashJoinNode::NodeDebugString(), impala::PartitionedHashJoinNode::OutputNullAwareProbeRows(), impala::PartitionedHashJoinNode::Prepare(), impala::PartitionedHashJoinNode::PrepareNextPartition(), impala::PartitionedHashJoinNode::PrepareNullAwarePartition(), impala::PartitionedHashJoinNode::ProcessBuildBatch(), impala::PartitionedHashJoinNode::ProcessBuildInput(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().
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().
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().
|
inline |
Definition at line 353 of file partitioned-hash-join-node.h.
References hash_tbl_.
Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), impala::PartitionedHashJoinNode::CleanUpHashPartitions(), impala::PartitionedHashJoinNode::NodeDebugString(), and 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.
|
inline |
Definition at line 355 of file partitioned-hash-join-node.h.
References is_closed_.
Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), impala::PartitionedHashJoinNode::CleanUpHashPartitions(), impala::PartitionedHashJoinNode::NodeDebugString(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().
|
inline |
Definition at line 356 of file partitioned-hash-join-node.h.
References is_spilled_.
Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), impala::PartitionedHashJoinNode::CleanUpHashPartitions(), impala::PartitionedHashJoinNode::LargestSpilledPartition(), impala::PartitionedHashJoinNode::NodeDebugString(), impala::PartitionedHashJoinNode::PrepareNextPartition(), impala::PartitionedHashJoinNode::ProcessBuildInput(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().
|
inline |
Definition at line 352 of file partitioned-hash-join-node.h.
References probe_rows_.
Referenced by impala::PartitionedHashJoinNode::BuildHashTables(), impala::PartitionedHashJoinNode::CleanUpHashPartitions(), impala::PartitionedHashJoinNode::NextSpilledProbeRowBatch(), impala::PartitionedHashJoinNode::NodeDebugString(), impala::PartitionedHashJoinNode::OutputNullAwareProbeRows(), impala::PartitionedHashJoinNode::Prepare(), impala::PartitionedHashJoinNode::PrepareNextPartition(), impala::PartitionedHashJoinNode::PrepareNullAwarePartition(), and impala::PartitionedHashJoinNode::ProcessProbeBatch().
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().
|
friend |
Definition at line 389 of file partitioned-hash-join-node.h.
|
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().
|
private |
The hash table for this partition.
Definition at line 406 of file partitioned-hash-join-node.h.
Referenced by impala::PartitionedHashJoinNode::CleanUpHashPartitions(), hash_tbl(), and impala::PartitionedHashJoinNode::NextSpilledProbeRowBatch().
|
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().
|
private |
True if this partition is spilled.
Definition at line 398 of file partitioned-hash-join-node.h.
Referenced by is_spilled().
|
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().
|
private |
Definition at line 391 of file partitioned-hash-join-node.h.
|
private |
Definition at line 414 of file partitioned-hash-join-node.h.
Referenced by probe_rows().