@Internal public class SplitAssignmentTracker<SplitT extends org.apache.flink.api.connector.source.SourceSplit> extends Object
SplitEnumerator.| Constructor and Description |
|---|
SplitAssignmentTracker() |
| Modifier and Type | Method and Description |
|---|---|
List<SplitT> |
getAndRemoveUncheckpointedAssignment(int subtaskId,
long restoredCheckpointId)
This method is invoked when a source reader fails over.
|
void |
onCheckpoint(long checkpointId)
Behavior of SplitAssignmentTracker on checkpoint.
|
void |
onCheckpointComplete(long checkpointId)
when a checkpoint has been successfully made, this method is invoked to clean up the
assignment history before this successful checkpoint.
|
void |
recordSplitAssignment(org.apache.flink.api.connector.source.SplitsAssignment<SplitT> splitsAssignment)
Record a new split assignment.
|
void |
restoreState(org.apache.flink.core.io.SimpleVersionedSerializer<SplitT> splitSerializer,
byte[] assignmentData)
Restore the state of the SplitAssignmentTracker.
|
byte[] |
snapshotState(org.apache.flink.core.io.SimpleVersionedSerializer<SplitT> splitSerializer)
Take a snapshot of the split assignments.
|
public void onCheckpoint(long checkpointId)
throws Exception
checkpointId - the id of the ongoing checkpointExceptionpublic byte[] snapshotState(org.apache.flink.core.io.SimpleVersionedSerializer<SplitT> splitSerializer) throws Exception
Exceptionpublic void restoreState(org.apache.flink.core.io.SimpleVersionedSerializer<SplitT> splitSerializer, byte[] assignmentData) throws Exception
splitSerializer - The serializer of the splits.assignmentData - The state of the SplitAssignmentTracker.Exception - when the state deserialization fails.public void onCheckpointComplete(long checkpointId)
checkpointId - the id of the successful checkpoint.public void recordSplitAssignment(org.apache.flink.api.connector.source.SplitsAssignment<SplitT> splitsAssignment)
splitsAssignment - the new split assignment.public List<SplitT> getAndRemoveUncheckpointedAssignment(int subtaskId, long restoredCheckpointId)
subtaskId - the subtask id of the reader that failed over.restoredCheckpointId - the ID of the checkpoint that the reader was restored to.SplitEnumerator.Copyright © 2014–2025 The Apache Software Foundation. All rights reserved.