java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.model.HeartbeatRecord
All Implemented Interfaces:
Serializable, ChangeStreamRecord

@DefaultCoder(AvroCoder.class) public class HeartbeatRecord extends Object implements ChangeStreamRecord
A heartbeat record serves as a notification that the change stream query has returned all changes for the partition less or equal to the record timestamp.
See Also:
  • Constructor Details

    • HeartbeatRecord

      public HeartbeatRecord(com.google.cloud.Timestamp timestamp, ChangeStreamRecordMetadata metadata)
      Constructs the heartbeat record with the given timestamp and metadata.
      Parameters:
      timestamp - the timestamp for which all changes in the partition have occurred
      metadata - connector execution metadata for the given record
  • Method Details

    • getRecordTimestamp

      public com.google.cloud.Timestamp getRecordTimestamp()
      Indicates the timestamp for which the change stream query has returned all changes. All records emitted after the heartbeat record will have a timestamp greater than this one.
      Specified by:
      getRecordTimestamp in interface ChangeStreamRecord
      Returns:
      the timestamp for which the change stream query has returned all changes
    • getTimestamp

      public com.google.cloud.Timestamp getTimestamp()
      Indicates the timestamp for which the change stream query has returned all changes. All records emitted after the heartbeat record will have a timestamp greater than this one.
      Returns:
      the timestamp for which the change stream query has returned all changes
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object