Constructor and Description |
---|
StateAssignmentOperation(long restoreCheckpointId,
Set<ExecutionJobVertex> tasks,
Map<OperatorID,OperatorState> operatorStates,
boolean allowNonRestoredState) |
Modifier and Type | Method and Description |
---|---|
static <T> Map<OperatorInstanceID,List<T>> |
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(org.apache.flink.runtime.checkpoint.TaskStateAssignment taskStateAssignment) |
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)
|
void |
reDistributeInputChannelStates(org.apache.flink.runtime.checkpoint.TaskStateAssignment stateAssignment) |
static <T extends StateObject> |
reDistributePartitionableStates(Map<OperatorID,OperatorState> oldOperatorStates,
int newParallelism,
Function<OperatorSubtaskState,StateObjectCollection<T>> extractHandle,
OperatorStateRepartitioner<T> stateRepartitioner,
Map<OperatorInstanceID,List<T>> result) |
void |
reDistributeResultSubpartitionStates(org.apache.flink.runtime.checkpoint.TaskStateAssignment assignment) |
public StateAssignmentOperation(long restoreCheckpointId, Set<ExecutionJobVertex> tasks, Map<OperatorID,OperatorState> operatorStates, boolean allowNonRestoredState)
public void assignStates()
public void checkParallelismPreconditions(org.apache.flink.runtime.checkpoint.TaskStateAssignment taskStateAssignment)
public static <T extends StateObject> void reDistributePartitionableStates(Map<OperatorID,OperatorState> oldOperatorStates, int newParallelism, Function<OperatorSubtaskState,StateObjectCollection<T>> extractHandle, OperatorStateRepartitioner<T> stateRepartitioner, Map<OperatorInstanceID,List<T>> result)
public void reDistributeResultSubpartitionStates(org.apache.flink.runtime.checkpoint.TaskStateAssignment assignment)
public void reDistributeInputChannelStates(org.apache.flink.runtime.checkpoint.TaskStateAssignment stateAssignment)
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> 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–2024 The Apache Software Foundation. All rights reserved.