public class StateAssignmentOperation extends Object
Constructor and Description |
---|
StateAssignmentOperation(long restoreCheckpointId,
Map<JobVertexID,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<OperatorStateHandle> chainOpParallelStates,
int oldParallelism,
int newParallelism) |
static List<Collection<OperatorStateHandle>> |
applyRepartitioner(OperatorStateRepartitioner opStateRepartitioner,
List<OperatorStateHandle> chainOpParallelStates,
int oldParallelism,
int newParallelism)
Repartitions the given operator state using the given
OperatorStateRepartitioner with respect to the new
parallelism. |
boolean |
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) |
public StateAssignmentOperation(long restoreCheckpointId, Map<JobVertexID,ExecutionJobVertex> tasks, Map<OperatorID,OperatorState> operatorStates, boolean allowNonRestoredState)
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 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 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<OperatorStateHandle> chainOpParallelStates, int oldParallelism, int newParallelism)
public static List<Collection<OperatorStateHandle>> applyRepartitioner(OperatorStateRepartitioner opStateRepartitioner, 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–2019 The Apache Software Foundation. All rights reserved.