@Internal public class BarrierTracker extends Object implements CheckpointBarrierHandler
Unlike the BarrierBuffer
, the BarrierTracker does not block the input
channels that have sent barriers, so it cannot be used to gain "exactly-once" processing
guarantees. It can, however, be used to gain "at least once" processing guarantees.
NOTE: This implementation strictly assumes that newer checkpoints have higher checkpoint IDs.
构造器和说明 |
---|
BarrierTracker(org.apache.flink.runtime.io.network.partition.consumer.InputGate inputGate) |
限定符和类型 | 方法和说明 |
---|---|
void |
cleanup()
Cleans up all internally held resources.
|
long |
getAlignmentDurationNanos()
Gets the time that the latest alignment took, in nanoseconds.
|
org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent |
getNextNonBlocked()
Returns the next
BufferOrEvent that the operator may consume. |
boolean |
isEmpty()
Checks if the barrier handler has buffered any data internally.
|
void |
registerCheckpointEventHandler(org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint)
Registers the task be notified once all checkpoint barriers have been received for a checkpoint.
|
public BarrierTracker(org.apache.flink.runtime.io.network.partition.consumer.InputGate inputGate)
public org.apache.flink.runtime.io.network.partition.consumer.BufferOrEvent getNextNonBlocked() throws Exception
CheckpointBarrierHandler
BufferOrEvent
that the operator may consume.
This call blocks until the next BufferOrEvent is available, or until the stream
has been determined to be finished.getNextNonBlocked
在接口中 CheckpointBarrierHandler
null
, if the stream is finished.IOException
- Thrown if the network or local disk I/O fails.InterruptedException
- Thrown if the thread is interrupted while blocking during
waiting for the next BufferOrEvent to become available.Exception
- Thrown in case that a checkpoint fails that is started as the result of receiving
the last checkpoint barrierpublic void registerCheckpointEventHandler(org.apache.flink.runtime.jobgraph.tasks.AbstractInvokable toNotifyOnCheckpoint)
CheckpointBarrierHandler
registerCheckpointEventHandler
在接口中 CheckpointBarrierHandler
toNotifyOnCheckpoint
- The task to notifypublic void cleanup()
CheckpointBarrierHandler
cleanup
在接口中 CheckpointBarrierHandler
public boolean isEmpty()
CheckpointBarrierHandler
isEmpty
在接口中 CheckpointBarrierHandler
True
, if no data is buffered internally, false
otherwise.public long getAlignmentDurationNanos()
CheckpointBarrierHandler
getAlignmentDurationNanos
在接口中 CheckpointBarrierHandler
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.