Class ChangeStreamRecord (3.66.0)

ChangeStreamRecord(mapping=None, *, ignore_unknown_fields=False, **kwargs)

Spanner Change Streams enable customers to capture and stream out changes to their Spanner databases in real-time. A change stream can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or partition_mode='MUTABLE_KEY_RANGE'.

This message is only used in Change Streams created with the option partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special Table-Valued Function (TVF) along with each Change Streams. The function provides access to the change stream's records. The function is named READ_<change_stream_name> (where <change_stream_name> is the name of the change stream), and it returns a table with only one column called ChangeRecord.

This message has oneof_ fields (mutually exclusive fields). For each oneof, at most one member field can be set at the same time. Setting any member of the oneof automatically clears all other members.

.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields

Attributes

Name Description
data_change_record google.cloud.spanner_v1.types.ChangeStreamRecord.DataChangeRecord
Data change record describing a data change for a change stream partition. This field is a member of oneof_ record.
heartbeat_record google.cloud.spanner_v1.types.ChangeStreamRecord.HeartbeatRecord
Heartbeat record describing a heartbeat for a change stream partition. This field is a member of oneof_ record.
partition_start_record google.cloud.spanner_v1.types.ChangeStreamRecord.PartitionStartRecord
Partition start record describing a new change stream partition. This field is a member of oneof_ record.
partition_end_record google.cloud.spanner_v1.types.ChangeStreamRecord.PartitionEndRecord
Partition end record describing a terminated change stream partition. This field is a member of oneof_ record.
partition_event_record google.cloud.spanner_v1.types.ChangeStreamRecord.PartitionEventRecord
Partition event record describing key range changes for a change stream partition. This field is a member of oneof_ record.

Classes

DataChangeRecord

DataChangeRecord(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A data change record contains a set of changes to a table with the same modification type (insert, update, or delete) committed at the same commit timestamp in one change stream partition for the same transaction. Multiple data change records can be returned for the same transaction across multiple change stream partitions.

HeartbeatRecord

HeartbeatRecord(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A heartbeat record is returned as a progress indicator, when there are no data changes or any other partition record types in the change stream partition.

PartitionEndRecord

PartitionEndRecord(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A partition end record serves as a notification that the client should stop reading the partition. No further records are expected to be retrieved on it.

PartitionEventRecord

PartitionEventRecord(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A partition event record describes key range changes for a change stream partition. The changes to a row defined by its primary key can be captured in one change stream partition for a specific time range, and then be captured in a different change stream partition for a different time range. This movement of key ranges across change stream partitions is a reflection of activities, such as Spanner's dynamic splitting and load balancing, etc. Processing this event is needed if users want to guarantee processing of the changes for any key in timestamp order. If time ordered processing of changes for a primary key is not needed, this event can be ignored. To guarantee time ordered processing for each primary key, if the event describes move-ins, the reader of this partition needs to wait until the readers of the source partitions have processed all records with timestamps <= this PartitionEventRecord.commit_timestamp, before advancing beyond this PartitionEventRecord. If the event describes move-outs, the reader can notify the readers of the destination partitions that they can continue processing.

PartitionStartRecord

PartitionStartRecord(mapping=None, *, ignore_unknown_fields=False, **kwargs)

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.