public interface HashJoinMemoryCalculator extends HashJoinStateCalculator<HashJoinMemoryCalculator.BuildSidePartitioning>
This class is responsible for managing the memory calculations for the HashJoin operator.
Since the HashJoin operator has different phases of execution, this class needs to perform
different memory calculations at each phase. The phases of execution have been broken down
into an explicit state machine diagram below. What ocurrs in each state is described in
the documentation of the HashJoinState class below. Note: the transition from Probing
and Partitioning back to Build Side Partitioning. This happens when we had to spill probe side
partitions and we needed to recursively process spilled partitions. This recursion is
described in more detail in the example below.
+--------------+ <-------+ | Build Side | | | Partitioning| | | | | +------+-------+ | | | | | v | +--------------+ | |Probing and | | |Partitioning | | | | | +--------------+ | | | +----------------+ | v Done
An overview of how these states interact can be summarized with the following example.
Consider the case where we have 4 partition configured initially.
| Modifier and Type | Interface and Description |
|---|---|
static class |
HashJoinMemoryCalculator.BatchStat |
static interface |
HashJoinMemoryCalculator.BuildSidePartitioning
The interface representing the
HashJoinStateCalculator corresponding to the
HashJoinState.BUILD_SIDE_PARTITIONING state. |
static interface |
HashJoinMemoryCalculator.PartitionStat |
static class |
HashJoinMemoryCalculator.PartitionStatSet
This class represents the memory size statistics for an entire set of partitions.
|
static interface |
HashJoinMemoryCalculator.PostBuildCalculations
The interface representing the
HashJoinStateCalculator corresponding to the
HashJoinState.POST_BUILD_CALCULATIONS state. |
| Modifier and Type | Method and Description |
|---|---|
void |
initialize(boolean doMemoryCalc) |
getState, nextCopyright © 2021 The Apache Software Foundation. All rights reserved.