T - The class holding spilled partition metadata.
SpilledState instance.initialize(int)addPartition(SpilledPartitionMetadata) (SpilledPartitionMetadata)}, getNextSpilledPartition(), or
updateCycle(OperatorStats, SpilledPartitionMetadata, Updater)
getCycle() at any time.public class SpilledState<T extends SpilledPartitionMetadata> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SpilledState.Updater
This is a class that is used to do updates of the spilled state.
|
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
SpilledState() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addPartition(T spilledPartition)
Add the partition metadata to the end of the queue to be processed.
|
int |
getBitsInMask() |
int |
getCycle()
Gets the current spill cycle.
|
T |
getNextSpilledPartition()
Get the next spilled partition to process.
|
int |
getNumPartitions()
Gets the number of partitions.
|
int |
getPartitionMask() |
void |
initialize(int numPartitions)
Initializes the number of partitions to use for the spilled state.
|
boolean |
isEmpty()
True if there are no spilled partitions.
|
boolean |
isFirstCycle()
True if this is the first cycle (0).
|
void |
updateCycle(OperatorStats operatorStats,
T spilledPartition,
SpilledState.Updater updater)
Update the current spill cycle.
|
public void initialize(int numPartitions)
numPartitions - The number of partitions to use for the spilled state.public int getNumPartitions()
public boolean isFirstCycle()
public int getPartitionMask()
public int getBitsInMask()
public boolean addPartition(T spilledPartition)
spilledPartition - The partition metadata to process.public T getNextSpilledPartition()
public boolean isEmpty()
public void updateCycle(OperatorStats operatorStats, T spilledPartition, SpilledState.Updater updater)
operatorStats - Current operator stats.spilledPartition - The next spilled partition metadata to process.updater - The updater implementation that executes custom logic if a spill cycle is incremented.public int getCycle()
Copyright © 2022 The Apache Software Foundation. All rights reserved.