@Experimental
public interface SplitAssigner
SplitAssigner is responsible for deciding what split should be processed. It
determines split processing order.| 限定符和类型 | 方法和说明 |
|---|---|
void |
addSplits(Collection<SourceSplitBase> splits)
Adds a set of splits to this assigner.
|
void |
close()
Called to close the assigner, in case it holds on to any resources, like threads or network
connections.
|
List<FinishedSnapshotSplitInfo> |
getFinishedSplitInfos()
Gets the finished splits information.
|
Optional<SourceSplitBase> |
getNext()
Gets the next split.
|
void |
notifyCheckpointComplete(long checkpointId)
Notifies the listener that the checkpoint with the given
checkpointId completed and
was committed. |
void |
onFinishedSplits(Map<String,Offset> splitFinishedOffsets)
Callback to handle the finished splits with finished binlog offset.
|
void |
open()
Called to open the assigner to acquire any resources, like threads or network connections.
|
PendingSplitsState |
snapshotState(long checkpointId)
Creates a snapshot of the state of this split assigner, to be stored in a checkpoint.
|
boolean |
waitingForFinishedSplits()
Whether the split assigner is still waiting for callback of finished splits, i.e.
|
void open()
Optional<SourceSplitBase> getNext()
When this method returns an empty Optional, then the set of splits is assumed to
be done and the source will finish once the readers finished their current splits.
boolean waitingForFinishedSplits()
onFinishedSplits(Map).List<FinishedSnapshotSplitInfo> getFinishedSplitInfos()
void onFinishedSplits(Map<String,Offset> splitFinishedOffsets)
void addSplits(Collection<SourceSplitBase> splits)
PendingSplitsState snapshotState(long checkpointId)
The snapshot should contain the latest state of the assigner: It should assume that all
operations that happened before the snapshot have successfully completed. For example all
splits assigned to readers via getNext() don't need to be included in the snapshot
anymore.
This method takes the ID of the checkpoint for which the state is snapshotted. Most implementations should be able to ignore this parameter, because for the contents of the snapshot, it doesn't matter for which checkpoint it gets created. This parameter can be interesting for source connectors with external systems where those systems are themselves aware of checkpoints; for example in cases where the enumerator notifies that system about a specific checkpoint being triggered.
checkpointId - The ID of the checkpoint for which the snapshot is created.void notifyCheckpointComplete(long checkpointId)
checkpointId completed and
was committed.CheckpointListener.notifyCheckpointComplete(long)void close()
Copyright © 2022 10MG. All rights reserved.