public class StreamSplitAssigner extends Object implements SplitAssigner
| 构造器和说明 |
|---|
StreamSplitAssigner(SourceConfig sourceConfig,
DataSourceDialect dialect,
OffsetFactory offsetFactory) |
StreamSplitAssigner(SourceConfig sourceConfig,
StreamPendingSplitsState checkpoint,
DataSourceDialect dialect,
OffsetFactory offsetFactory) |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
StreamSplit |
createStreamSplit() |
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.
|
public StreamSplitAssigner(SourceConfig sourceConfig, DataSourceDialect dialect, OffsetFactory offsetFactory)
public StreamSplitAssigner(SourceConfig sourceConfig, StreamPendingSplitsState checkpoint, DataSourceDialect dialect, OffsetFactory offsetFactory)
public void open()
SplitAssigneropen 在接口中 SplitAssignerpublic Optional<SourceSplitBase> getNext()
SplitAssignerWhen 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.
getNext 在接口中 SplitAssignerpublic boolean waitingForFinishedSplits()
SplitAssignerSplitAssigner.onFinishedSplits(Map).waitingForFinishedSplits 在接口中 SplitAssignerpublic List<FinishedSnapshotSplitInfo> getFinishedSplitInfos()
SplitAssignergetFinishedSplitInfos 在接口中 SplitAssignerpublic void onFinishedSplits(Map<String,Offset> splitFinishedOffsets)
SplitAssigneronFinishedSplits 在接口中 SplitAssignerpublic void addSplits(Collection<SourceSplitBase> splits)
SplitAssigneraddSplits 在接口中 SplitAssignerpublic PendingSplitsState snapshotState(long checkpointId)
SplitAssignerThe 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 SplitAssigner.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.
snapshotState 在接口中 SplitAssignercheckpointId - The ID of the checkpoint for which the snapshot is created.public void notifyCheckpointComplete(long checkpointId)
SplitAssignercheckpointId completed and
was committed.notifyCheckpointComplete 在接口中 SplitAssignerCheckpointListener.notifyCheckpointComplete(long)public void close()
SplitAssignerclose 在接口中 SplitAssignerpublic StreamSplit createStreamSplit()
Copyright © 2022 10MG. All rights reserved.