Constructor and Description |
---|
StateAssignmentOperation(long restoreCheckpointId,
Set<ExecutionJobVertex> tasks,
Map<OperatorID,OperatorState> operatorStates,
boolean allowNonRestoredState) |
Modifier and Type | Method and Description |
---|---|
static <T extends StateObject> |
applyRepartitioner(OperatorID operatorID,
OperatorStateRepartitioner<T> opStateRepartitioner,
List<List<T>> chainOpParallelStates,
int oldParallelism,
int newParallelism) |
static <T> List<List<T>> |
applyRepartitioner(OperatorStateRepartitioner<T> opStateRepartitioner,
List<List<T>> chainOpParallelStates,
int oldParallelism,
int newParallelism)
Repartitions the given operator state using the given
OperatorStateRepartitioner with
respect to the new parallelism. |
void |
assignStates() |
void |
checkParallelismPreconditions(List<OperatorState> operatorStates,
ExecutionJobVertex executionJobVertex) |
static List<KeyGroupRange> |
createKeyGroupPartitions(int numberKeyGroups,
int parallelism)
Groups the available set of key groups into key group partitions.
|
static void |
extractIntersectingState(Collection<? extends KeyedStateHandle> originalSubtaskStateHandles,
KeyGroupRange rangeToExtract,
List<KeyedStateHandle> extractedStateCollector)
Extracts certain key group ranges from the given state handles and adds them to the
collector.
|
static List<KeyedStateHandle> |
getManagedKeyedStateHandles(OperatorState operatorState,
KeyGroupRange subtaskKeyGroupRange)
Collect
managedKeyedStateHandles which have intersection with
given KeyGroupRange from operatorState . |
static List<KeyedStateHandle> |
getRawKeyedStateHandles(OperatorState operatorState,
KeyGroupRange subtaskKeyGroupRange)
|
static OperatorSubtaskState |
operatorSubtaskStateFrom(OperatorInstanceID instanceID,
Map<OperatorInstanceID,List<OperatorStateHandle>> subManagedOperatorState,
Map<OperatorInstanceID,List<OperatorStateHandle>> subRawOperatorState,
Map<OperatorInstanceID,List<InputChannelStateHandle>> inputChannelStates,
Map<OperatorInstanceID,List<ResultSubpartitionStateHandle>> resultSubpartitionStates,
Map<OperatorInstanceID,List<KeyedStateHandle>> subManagedKeyedState,
Map<OperatorInstanceID,List<KeyedStateHandle>> subRawKeyedState) |
static <T extends StateObject> |
reDistributePartitionableStates(List<OperatorState> oldOperatorStates,
int newParallelism,
List<OperatorIDPair> newOperatorIDs,
java.util.function.Function<OperatorSubtaskState,StateObjectCollection<T>> extractHandle,
OperatorStateRepartitioner<T> stateRepartitioner) |
public StateAssignmentOperation(long restoreCheckpointId, Set<ExecutionJobVertex> tasks, Map<OperatorID,OperatorState> operatorStates, boolean allowNonRestoredState)
public void assignStates()
public static OperatorSubtaskState operatorSubtaskStateFrom(OperatorInstanceID instanceID, Map<OperatorInstanceID,List<OperatorStateHandle>> subManagedOperatorState, Map<OperatorInstanceID,List<OperatorStateHandle>> subRawOperatorState, Map<OperatorInstanceID,List<InputChannelStateHandle>> inputChannelStates, Map<OperatorInstanceID,List<ResultSubpartitionStateHandle>> resultSubpartitionStates, Map<OperatorInstanceID,List<KeyedStateHandle>> subManagedKeyedState, Map<OperatorInstanceID,List<KeyedStateHandle>> subRawKeyedState)
public void checkParallelismPreconditions(List<OperatorState> operatorStates, ExecutionJobVertex executionJobVertex)
public static <T extends StateObject> Map<OperatorInstanceID,List<T>> reDistributePartitionableStates(List<OperatorState> oldOperatorStates, int newParallelism, List<OperatorIDPair> newOperatorIDs, java.util.function.Function<OperatorSubtaskState,StateObjectCollection<T>> extractHandle, OperatorStateRepartitioner<T> stateRepartitioner)
public static List<KeyedStateHandle> getManagedKeyedStateHandles(OperatorState operatorState, KeyGroupRange subtaskKeyGroupRange)
managedKeyedStateHandles
which have intersection with
given KeyGroupRange
from operatorState
.operatorState
- all state handles of a operatorsubtaskKeyGroupRange
- the KeyGroupRange of a subtaskpublic static List<KeyedStateHandle> getRawKeyedStateHandles(OperatorState operatorState, KeyGroupRange subtaskKeyGroupRange)
operatorState
- all state handles of a operatorsubtaskKeyGroupRange
- the KeyGroupRange of a subtask@VisibleForTesting public static void extractIntersectingState(Collection<? extends KeyedStateHandle> originalSubtaskStateHandles, KeyGroupRange rangeToExtract, List<KeyedStateHandle> extractedStateCollector)
public static List<KeyGroupRange> createKeyGroupPartitions(int numberKeyGroups, int parallelism)
IMPORTANT: The assignment of key groups to partitions has to be in sync with the KeyGroupStreamPartitioner.
numberKeyGroups
- Number of available key groups (indexed from 0 to numberKeyGroups - 1)parallelism
- Parallelism to generate the key group partitioning forpublic static <T extends StateObject> Map<OperatorInstanceID,List<T>> applyRepartitioner(OperatorID operatorID, OperatorStateRepartitioner<T> opStateRepartitioner, List<List<T>> chainOpParallelStates, int oldParallelism, int newParallelism)
public static <T> List<List<T>> applyRepartitioner(OperatorStateRepartitioner<T> opStateRepartitioner, List<List<T>> chainOpParallelStates, int oldParallelism, int newParallelism)
OperatorStateRepartitioner
with
respect to the new parallelism.opStateRepartitioner
- partitioner to usechainOpParallelStates
- state to repartitionoldParallelism
- parallelism with which the state is currently partitionednewParallelism
- parallelism with which the state should be partitionedCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.