Class: Google::Apis::SpannerV1::ChangeStreamRecord
- Inherits:
-
Object
- Object
- Google::Apis::SpannerV1::ChangeStreamRecord
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/spanner_v1/classes.rb,
lib/google/apis/spanner_v1/representations.rb,
lib/google/apis/spanner_v1/representations.rb
Overview
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_ (where is the name of the change stream), and it returns a table with only one column called ChangeRecord.
Instance Attribute Summary collapse
-
#data_change_record ⇒ Google::Apis::SpannerV1::DataChangeRecord
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.
-
#heartbeat_record ⇒ Google::Apis::SpannerV1::HeartbeatRecord
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.
-
#partition_end_record ⇒ Google::Apis::SpannerV1::PartitionEndRecord
A partition end record serves as a notification that the client should stop reading the partition.
-
#partition_event_record ⇒ Google::Apis::SpannerV1::PartitionEventRecord
A partition event record describes key range changes for a change stream partition.
-
#partition_start_record ⇒ Google::Apis::SpannerV1::PartitionStartRecord
A partition start record serves as a notification that the client should schedule the partitions to be queried.
Instance Method Summary collapse
-
#initialize(**args) ⇒ ChangeStreamRecord
constructor
A new instance of ChangeStreamRecord.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ ChangeStreamRecord
Returns a new instance of ChangeStreamRecord.
1152 1153 1154 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1152 def initialize(**args) update!(**args) end |
Instance Attribute Details
#data_change_record ⇒ Google::Apis::SpannerV1::DataChangeRecord
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.
Corresponds to the JSON property dataChangeRecord
1112 1113 1114 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1112 def data_change_record @data_change_record end |
#heartbeat_record ⇒ Google::Apis::SpannerV1::HeartbeatRecord
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.
Corresponds to the JSON property heartbeatRecord
1118 1119 1120 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1118 def heartbeat_record @heartbeat_record end |
#partition_end_record ⇒ Google::Apis::SpannerV1::PartitionEndRecord
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.
Corresponds to the JSON property partitionEndRecord
1124 1125 1126 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1124 def partition_end_record @partition_end_record end |
#partition_event_record ⇒ Google::Apis::SpannerV1::PartitionEventRecord
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.
Corresponds to the JSON property partitionEventRecord
1143 1144 1145 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1143 def partition_event_record @partition_event_record end |
#partition_start_record ⇒ Google::Apis::SpannerV1::PartitionStartRecord
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.
Corresponds to the JSON property partitionStartRecord
1150 1151 1152 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1150 def partition_start_record @partition_start_record end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1157 1158 1159 1160 1161 1162 1163 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1157 def update!(**args) @data_change_record = args[:data_change_record] if args.key?(:data_change_record) @heartbeat_record = args[:heartbeat_record] if args.key?(:heartbeat_record) @partition_end_record = args[:partition_end_record] if args.key?(:partition_end_record) @partition_event_record = args[:partition_event_record] if args.key?(:partition_event_record) @partition_start_record = args[:partition_start_record] if args.key?(:partition_start_record) end |