Class CommittableCollector<CommT>
java.lang.Object
org.apache.flink.streaming.runtime.operators.sink.committables.CommittableCollector<CommT>
- Type Parameters:
CommT- type of committable
This class is responsible to book-keep the committing progress across checkpoints and upstream
subtasks.
Each checkpoint in turn is handled by a CheckpointCommittableManager.
-
Constructor Summary
ConstructorsConstructorDescriptionCommittableCollector(org.apache.flink.metrics.groups.SinkCommitterMetricGroup metricGroup) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(CommittableMessage<CommT> message) Adds aCommittableMessageto the collector to hold it until emission.copy()Returns a new committable collector that deep copies all internals.booleanCollection<? extends CheckpointCommittableManager<CommT>>getCheckpointCommittablesUpTo(long checkpointId) Returns allCheckpointCommittableManageruntil the requested checkpoint id.ReturnsCheckpointCommittableManagerbelonging to the last input.inthashCode()booleanReturns whether allCheckpointCommittableManagercurrently hold by the collector are either committed or failed.voidMerges all information from an external collector into this collector.static <CommT> CommittableCollector<CommT>of(org.apache.flink.metrics.groups.SinkCommitterMetricGroup metricGroup) Creates aCommittableCollectorbased on the current runtime information.voidremove(CheckpointCommittableManager<CommT> manager) Removes the manager for a specific checkpoint and all it's metadata.toString()
-
Constructor Details
-
CommittableCollector
public CommittableCollector(org.apache.flink.metrics.groups.SinkCommitterMetricGroup metricGroup)
-
-
Method Details
-
of
public static <CommT> CommittableCollector<CommT> of(org.apache.flink.metrics.groups.SinkCommitterMetricGroup metricGroup) Creates aCommittableCollectorbased on the current runtime information. This method should be used for to instantiate a collector for all Sink V2.- Type Parameters:
CommT- type of the committable- Parameters:
metricGroup- storing the committable metrics- Returns:
CommittableCollector
-
addMessage
Adds aCommittableMessageto the collector to hold it until emission.- Parameters:
message- eitherCommittableSummaryorCommittableWithLineage
-
getCheckpointCommittablesUpTo
public Collection<? extends CheckpointCommittableManager<CommT>> getCheckpointCommittablesUpTo(long checkpointId) Returns allCheckpointCommittableManageruntil the requested checkpoint id.- Parameters:
checkpointId- counter- Returns:
- collection of
CheckpointCommittableManager
-
getEndOfInputCommittable
ReturnsCheckpointCommittableManagerbelonging to the last input.- Returns:
CheckpointCommittableManager
-
isFinished
public boolean isFinished()Returns whether allCheckpointCommittableManagercurrently hold by the collector are either committed or failed.- Returns:
- state of the
CheckpointCommittableManager
-
merge
Merges all information from an external collector into this collector.This method is important during recovery from existing state.
- Parameters:
cc- otherCommittableCollector
-
copy
Returns a new committable collector that deep copies all internals.- Returns:
CommittableCollector
-
remove
Removes the manager for a specific checkpoint and all it's metadata. -
equals
-
hashCode
public int hashCode() -
toString
-