Class PartitionEventRecord
- java.lang.Object
-
- org.apache.beam.sdk.io.gcp.spanner.changestreams.model.PartitionEventRecord
-
- All Implemented Interfaces:
java.io.Serializable,ChangeStreamRecord
@DefaultCoder(org.apache.beam.sdk.extensions.avro.coders.AvroCoder.class) public class PartitionEventRecord extends java.lang.Object implements ChangeStreamRecord
A partition event record describes key range changes for a change stream partition. This record is only used for updating watermark in the dataflow connector. MoveInEvent and MoveOutEvent are not tracked as they will not be used in the dataflow connector.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description PartitionEventRecord(com.google.cloud.Timestamp commitTimestamp, java.lang.String recordSequence, ChangeStreamRecordMetadata metadata)Constructs the partition event record with the given partitions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)com.google.cloud.TimestampgetCommitTimestamp()Returns the timestamp at which the key range change occurred.java.lang.StringgetRecordSequence()Indicates the order in which a record was put to the stream.com.google.cloud.TimestampgetRecordTimestamp()Returns the timestamp at which the key range change occurred.inthashCode()java.lang.StringtoString()
-
-
-
Constructor Detail
-
PartitionEventRecord
public PartitionEventRecord(com.google.cloud.Timestamp commitTimestamp, java.lang.String recordSequence, ChangeStreamRecordMetadata metadata)Constructs the partition event record with the given partitions.- Parameters:
commitTimestamp- the timestamp at which the key range change occurredrecordSequence- the order within a partition and a transaction in which the record was put to the streammetadata- connector execution metadata for the given record
-
-
Method Detail
-
getRecordTimestamp
public com.google.cloud.Timestamp getRecordTimestamp()
Returns the timestamp at which the key range change occurred.- Specified by:
getRecordTimestampin interfaceChangeStreamRecord- Returns:
- the start timestamp of the partition
-
getCommitTimestamp
public com.google.cloud.Timestamp getCommitTimestamp()
Returns the timestamp at which the key range change occurred.- Returns:
- the commit timestamp of the key range change
-
getRecordSequence
public java.lang.String getRecordSequence()
Indicates the order in which a record was put to the stream. Is unique and increasing within a partition. It is relative to the scope of partition, commit timestamp, and server_transaction_id. It is useful for readers downstream to dedup any duplicate records that were read/recorded.- Returns:
- record sequence of the record
-
equals
public boolean equals(@Nullable java.lang.Object o)- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-