@Internal public class StateAssignmentOperation extends Object
| Constructor and Description |
|---|
StateAssignmentOperation(long restoreCheckpointId,
Set<ExecutionJobVertex> tasks,
Map<OperatorID,OperatorState> operatorStates,
boolean allowNonRestoredState) |
| Modifier and Type | Method and Description |
|---|---|
static Map<OperatorInstanceID,List<OperatorStateHandle>> |
applyRepartitioner(OperatorID operatorID,
OperatorStateRepartitioner opStateRepartitioner,
List<List<OperatorStateHandle>> chainOpParallelStates,
int oldParallelism,
int newParallelism) |
static List<List<OperatorStateHandle>> |
applyRepartitioner(OperatorStateRepartitioner opStateRepartitioner,
List<List<OperatorStateHandle>> 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 List<KeyedStateHandle> |
getKeyedStateHandles(Collection<? extends KeyedStateHandle> keyedStateHandles,
KeyGroupRange subtaskKeyGroupRange)
Determine the subset of
KeyGroupsStateHandles with correct
key group index for the given subtask KeyGroupRange. |
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<KeyedStateHandle>> subManagedKeyedState,
Map<OperatorInstanceID,List<KeyedStateHandle>> subRawKeyedState) |
static void |
reDistributePartitionableStates(List<OperatorState> oldOperatorStates,
int newParallelism,
List<OperatorID> newOperatorIDs,
Map<OperatorInstanceID,List<OperatorStateHandle>> newManagedOperatorStates,
Map<OperatorInstanceID,List<OperatorStateHandle>> newRawOperatorStates) |
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<KeyedStateHandle>> subManagedKeyedState, Map<OperatorInstanceID,List<KeyedStateHandle>> subRawKeyedState)
public void checkParallelismPreconditions(List<OperatorState> operatorStates, ExecutionJobVertex executionJobVertex)
public static void reDistributePartitionableStates(List<OperatorState> oldOperatorStates, int newParallelism, List<OperatorID> newOperatorIDs, Map<OperatorInstanceID,List<OperatorStateHandle>> newManagedOperatorStates, Map<OperatorInstanceID,List<OperatorStateHandle>> newRawOperatorStates)
public static List<KeyedStateHandle> getManagedKeyedStateHandles(OperatorState operatorState, KeyGroupRange subtaskKeyGroupRange)
managedKeyedStateHandles which have intersection with given
KeyGroupRange from operatorStateoperatorState - 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 subtaskpublic 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 Map<OperatorInstanceID,List<OperatorStateHandle>> applyRepartitioner(OperatorID operatorID, OperatorStateRepartitioner opStateRepartitioner, List<List<OperatorStateHandle>> chainOpParallelStates, int oldParallelism, int newParallelism)
public static List<List<OperatorStateHandle>> applyRepartitioner(OperatorStateRepartitioner opStateRepartitioner, List<List<OperatorStateHandle>> 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 partitionedpublic static List<KeyedStateHandle> getKeyedStateHandles(Collection<? extends KeyedStateHandle> keyedStateHandles, KeyGroupRange subtaskKeyGroupRange)
KeyGroupsStateHandles with correct
key group index for the given subtask KeyGroupRange.
This is publicly visible to be used in tests.
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.