com.google.cloud.dataflow.sdk.io

## Class CountingSource.CounterMark

- java.lang.Object
- - com.google.cloud.dataflow.sdk.io.CountingSource.CounterMark

All Implemented Interfaces:
  UnboundedSource.CheckpointMark

Enclosing class:
  CountingSource

    @DefaultCoder(value=AvroCoder.class)
    public static class CountingSource.CounterMark
    extends Object
    implements UnboundedSource.CheckpointMark

The checkpoint for an unbounded `CountingSource` is simply the last value produced. The associated source object encapsulates the information needed to produce the next value.

### Constructor Summary

Constructors
Constructor and Description
`CounterMark(long lastEmitted, Instant startTime)` Creates a checkpoint mark reflecting the last emitted value.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `finalizeCheckpoint()` Perform any finalization that needs to happen after a bundle of data read from the source has been processed and committed.
`long` `getLastEmitted()` Returns the last value emitted by the reader.
`Instant` `getStartTime()` Returns the time the reader was started.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### CounterMark

    public CounterMark(long lastEmitted,
                       Instant startTime)

Creates a checkpoint mark reflecting the last emitted value.

### Method Detail

#### getLastEmitted

    public long getLastEmitted()

Returns the last value emitted by the reader.

#### getStartTime

    public Instant getStartTime()

Returns the time the reader was started.

#### finalizeCheckpoint

    public void finalizeCheckpoint()
                            throws IOException

Description copied from interface: `UnboundedSource.CheckpointMark`
Perform any finalization that needs to happen after a bundle of data read from the source has been processed and committed.

For example, this could be sending acknowledgement requests to an external data source such as Pub/Sub.

This may be called from any thread, potentially at the same time as calls to the `UnboundedReader` that created it.

Specified by:
  `finalizeCheckpoint` in interface `UnboundedSource.CheckpointMark`
Throws:
  `IOException`