Class DefaultSplitAssigner
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- SplitAssigner
- 
Constructor SummaryConstructorsConstructorDescriptionDefaultSplitAssigner(SerializableComparator<IcebergSourceSplit> comparator) DefaultSplitAssigner(SerializableComparator<IcebergSourceSplit> comparator, Collection<IcebergSourceSplitState> assignerState) 
- 
Method SummaryModifier and TypeMethodDescriptionRequest a new split from the assigner when enumerator trying to assign splits to awaiting readers.Enumerator can get a notification via CompletableFuture when the assigner has more splits available later.voidAdd new splits discovered by enumeratorvoidForward addSplitsBack event (for failed reader) to assignerlongReturn the number of pending records, which can act as a measure of the source lag.intReturn the number of pending splits that haven't been assigned yet.state()Simple assigner only tracks unassigned splitsMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.flink.source.assigner.SplitAssignerclose, onCompletedSplits, start
- 
Constructor Details- 
DefaultSplitAssigner
- 
DefaultSplitAssignerpublic DefaultSplitAssigner(SerializableComparator<IcebergSourceSplit> comparator, Collection<IcebergSourceSplitState> assignerState) 
 
- 
- 
Method Details- 
getNextDescription copied from interface:SplitAssignerRequest a new split from the assigner when enumerator trying to assign splits to awaiting readers.If enumerator wasn't able to assign the split (e.g., reader disconnected), enumerator should call SplitAssigner.onUnassignedSplits(java.util.Collection<org.apache.iceberg.flink.source.split.IcebergSourceSplit>)to return the split.- Specified by:
- getNextin interface- SplitAssigner
 
- 
onDiscoveredSplitsDescription copied from interface:SplitAssignerAdd new splits discovered by enumerator- Specified by:
- onDiscoveredSplitsin interface- SplitAssigner
 
- 
onUnassignedSplitsDescription copied from interface:SplitAssignerForward addSplitsBack event (for failed reader) to assigner- Specified by:
- onUnassignedSplitsin interface- SplitAssigner
 
- 
stateSimple assigner only tracks unassigned splits- Specified by:
- statein interface- SplitAssigner
 
- 
isAvailableDescription copied from interface:SplitAssignerEnumerator can get a notification via CompletableFuture when the assigner has more splits available later. Enumerator should schedule assignment in the thenAccept action of the future.Assigner will return the same future if this method is called again before the previous future is completed. The future can be completed from other thread, e.g. the coordinator thread from another thread for event time alignment. If enumerator need to trigger action upon the future completion, it may want to run it in the coordinator thread using SplitEnumeratorContext.runInCoordinatorThread(Runnable).- Specified by:
- isAvailablein interface- SplitAssigner
 
- 
pendingSplitCountpublic int pendingSplitCount()Description copied from interface:SplitAssignerReturn the number of pending splits that haven't been assigned yet.The enumerator can poll this API to publish a metric on the number of pending splits. The enumerator can also use this information to throttle split discovery for streaming read. If there are already many pending splits tracked by the assigner, it is undesirable to discover more splits and track them in the assigner. That will increase the memory footprint and enumerator checkpoint size. Throttling works better together with ScanContext.maxPlanningSnapshotCount(). Otherwise, the next split discovery after throttling will just discover all non-enumerated snapshots and splits, which defeats the purpose of throttling.- Specified by:
- pendingSplitCountin interface- SplitAssigner
 
- 
pendingRecordspublic long pendingRecords()Description copied from interface:SplitAssignerReturn the number of pending records, which can act as a measure of the source lag. This value could be an estimation if the exact number of records cannot be accurately computed.- Specified by:
- pendingRecordsin interface- SplitAssigner
 
 
-