Interface CheckpointCommittableManager<CommT>
- Type Parameters:
CommT- type of the committable
@Internal
public interface CheckpointCommittableManager<CommT>
A
CheckpointCommittableManager collects committables for one checkpoint across
potentially multiple upstream subtasks.
While it collects committables from multiple upstream subtasks, it belongs to exactly one committer subtask.
Each upstream subtask of this particular checkpoint is represented by a SubtaskCommittableManager.
-
Method Summary
Modifier and TypeMethodDescriptionvoidCommits all due committables if all respective committables of the specific subtask and checkpoint have been received.longReturns the checkpoint id in which the committables were created.intReturns the number of upstream subtasks belonging to the checkpoint.intReturns the number of committables that have failed with a known error.Returns the number of committables that have been successfully committed; that is, the correspondingCommitter.CommitRequestwas not used to signal an error of any kind (retryable or not).booleanReturns true if all committables of all upstream subtasks arrived, which is only guaranteed to happen if the DOP of the caller is 1.boolean
-
Method Details
-
getCheckpointId
long getCheckpointId()Returns the checkpoint id in which the committables were created.- Returns:
- checkpoint id
-
getNumberOfSubtasks
int getNumberOfSubtasks()Returns the number of upstream subtasks belonging to the checkpoint. -
isFinished
boolean isFinished() -
hasGloballyReceivedAll
boolean hasGloballyReceivedAll()Returns true if all committables of all upstream subtasks arrived, which is only guaranteed to happen if the DOP of the caller is 1. -
commit
void commit(org.apache.flink.api.connector.sink2.Committer<CommT> committer, int maxRetries) throws IOException, InterruptedException Commits all due committables if all respective committables of the specific subtask and checkpoint have been received.- Parameters:
committer- used to commit to the external systemmaxRetries-- Throws:
IOExceptionInterruptedException
-
getSuccessfulCommittables
Collection<CommT> getSuccessfulCommittables()Returns the number of committables that have been successfully committed; that is, the correspondingCommitter.CommitRequestwas not used to signal an error of any kind (retryable or not).- Returns:
- number of successful committables
-
getNumFailed
int getNumFailed()Returns the number of committables that have failed with a known error. By the current semantics ofCommitter.CommitRequest.signalFailedWithKnownReason(Throwable)discards the committable but proceeds processing. The returned number should be emitted downstream in aCommittableSummary, such that downstream can assess if all committables have been processed.- Returns:
- number of failed committables
-