Class HeartbeatRecord
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.model.HeartbeatRecord
-
- All Implemented Interfaces:
java.io.Serializable
,ChangeStreamRecord
@DefaultCoder(org.apache.beam.sdk.coders.AvroCoder.class) public class HeartbeatRecord extends java.lang.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HeartbeatRecord(com.google.cloud.Timestamp timestamp, ChangeStreamRecordMetadata metadata)
Constructs the heartbeat record with the given timestamp and metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
com.google.cloud.Timestamp
getRecordTimestamp()
Indicates the timestamp for which the change stream query has returned all changes.com.google.cloud.Timestamp
getTimestamp()
Indicates the timestamp for which the change stream query has returned all changes.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
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 occurredmetadata
- connector execution metadata for the given record
-
-
Method Detail
-
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 interfaceChangeStreamRecord
- 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 java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-