@DefaultCoder(value=AvroCoder.class) public static class CountingSource.CounterMark extends java.lang.Object implements UnboundedSource.CheckpointMark
CountingSource
is simply the last value produced. The
associated source object encapsulates the information needed to produce the next value.UnboundedSource.CheckpointMark.NoopCheckpointMark
NOOP_CHECKPOINT_MARK
Constructor and Description |
---|
CounterMark(long lastEmitted,
Instant startTime)
Creates a checkpoint mark reflecting the last emitted value.
|
Modifier and Type | Method and Description |
---|---|
void |
finalizeCheckpoint()
Called by the system to signal that this checkpoint mark has been committed along with all
the records which have been read from the
UnboundedSource.UnboundedReader since the previous
checkpoint was taken. |
long |
getLastEmitted()
Returns the last value emitted by the reader.
|
Instant |
getStartTime()
Returns the time the reader was started.
|
public CounterMark(long lastEmitted, Instant startTime)
public long getLastEmitted()
public Instant getStartTime()
public void finalizeCheckpoint() throws java.io.IOException
UnboundedSource.CheckpointMark
UnboundedSource.UnboundedReader
since the previous
checkpoint was taken.
For example, this method could send acknowledgements to an external data source such as Pubsub.
Note that:
UnboundedSource.UnboundedReader
it was created from.
UnboundedSource.UnboundedReader
has not
yet be finalized.
UnboundedSource.UnboundedReader
.
UnboundedSource.UnboundedReader
from which this checkpoint was
created still exists at the time this method is called.
finalizeCheckpoint
in interface UnboundedSource.CheckpointMark
java.io.IOException