Class PartitionStartRecord
java.lang.Object
org.apache.beam.sdk.io.gcp.spanner.changestreams.model.PartitionStartRecord
- All Implemented Interfaces:
Serializable,ChangeStreamRecord
@DefaultCoder(AvroCoder.class)
public class PartitionStartRecord
extends Object
implements ChangeStreamRecord
A partition start record serves as a notification that the client should schedule the partitions
to be queried. PartitionStartRecord returns information about one or more partitions.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPartitionStartRecord(com.google.cloud.Timestamp startTimestamp, String recordSequence, List<String> partitionTokens, ChangeStreamRecordMetadata metadata) Constructs the partition start record with the given partitions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanList of partitions yielded within this record.Indicates the order in which a record was put to the stream.com.google.cloud.TimestampReturns the timestamp that which these partitions started being valid in Cloud Spanner.com.google.cloud.TimestampIt is the partition start time of the partition tokens.inthashCode()toString()
-
Constructor Details
-
PartitionStartRecord
public PartitionStartRecord(com.google.cloud.Timestamp startTimestamp, String recordSequence, List<String> partitionTokens, ChangeStreamRecordMetadata metadata) Constructs the partition start record with the given partitions.- Parameters:
startTimestamp- the timestamp which these partitions started being valid in Cloud SpannerrecordSequence- the order within a partition and a transaction in which the record was put to the streampartitionTokens- Unique partition identifiers to be used in queriesmetadata- connector execution metadata for the given record
-
-
Method Details
-
getRecordTimestamp
public com.google.cloud.Timestamp getRecordTimestamp()Returns the timestamp that which these partitions started being valid in Cloud Spanner. The caller must use this time as the change stream query start timestamp for the new partitions.- Specified by:
getRecordTimestampin interfaceChangeStreamRecord- Returns:
- the start timestamp of the partitions
-
getStartTimestamp
public com.google.cloud.Timestamp getStartTimestamp()It is the partition start time of the partition tokens.- Returns:
- the start timestamp of the partitions
-
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
-
getPartitionTokens
List of partitions yielded within this record.- Returns:
- partition tokens
-
equals
-
hashCode
public int hashCode() -
toString
-