Class ChildPartitionsEvent
java.lang.Object
io.debezium.connector.spanner.db.model.event.ChildPartitionsEvent
- All Implemented Interfaces:
ChangeStreamEvent
Specific DTO for Spanner Change Stream Child event
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<ChildPartition>private final StreamEventMetadataprivate final Stringprivate final com.google.cloud.Timestamp -
Constructor Summary
ConstructorsConstructorDescriptionChildPartitionsEvent(com.google.cloud.Timestamp startTimestamp, String recordSequence, List<ChildPartition> childPartitions, StreamEventMetadata metadata) Constructs a child partitions record containing one or more child partitions. -
Method Summary
Modifier and TypeMethodDescriptionList of child 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 this partition started being valid in Cloud Spanner.com.google.cloud.TimestampIt is the partition_start_time of the child partition token.toString()
-
Field Details
-
startTimestamp
private final com.google.cloud.Timestamp startTimestamp -
recordSequence
-
childPartitions
-
metadata
-
-
Constructor Details
-
ChildPartitionsEvent
public ChildPartitionsEvent(com.google.cloud.Timestamp startTimestamp, String recordSequence, List<ChildPartition> childPartitions, StreamEventMetadata metadata) Constructs a child partitions record containing one or more child partitions.- Parameters:
startTimestamp- the timestamp which this partition started being valid in Cloud SpannerrecordSequence- the order within a partition and a transaction in which the record was put to the streamchildPartitions- child partition tokens emitted within this recordmetadata- connector execution metadata for the given record
-
-
Method Details
-
getRecordTimestamp
public com.google.cloud.Timestamp getRecordTimestamp()Returns the timestamp that which this partition 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 interfaceChangeStreamEvent- Returns:
- the start timestamp of the partition
-
getStartTimestamp
public com.google.cloud.Timestamp getStartTimestamp()It is the partition_start_time of the child partition token. This partition_start_time is guaranteed to be the same across all the child partitions yielded from a parent. When users start new queries with the child partition tokens, the returned records must have a timestamp >= partition_start_time.- Returns:
- the start timestamp of the partition
-
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
-
getChildPartitions
List of child partitions yielded within this record.- Returns:
- child partitions
-
getMetadata
- Specified by:
getMetadatain interfaceChangeStreamEvent
-
toString
-