Class: Google::Apis::SpannerV1::DataChangeRecord
- Inherits:
-
Object
- Object
- Google::Apis::SpannerV1::DataChangeRecord
- 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
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.
Instance Attribute Summary collapse
-
#column_metadata ⇒ Array<Google::Apis::SpannerV1::ColumnMetadata>
Provides metadata describing the columns associated with the mods listed below.
-
#commit_timestamp ⇒ String
Indicates the timestamp in which the change was committed.
-
#is_last_record_in_transaction_in_partition ⇒ Boolean
(also: #is_last_record_in_transaction_in_partition?)
Indicates whether this is the last record for a transaction in the current partition.
-
#is_system_transaction ⇒ Boolean
(also: #is_system_transaction?)
Indicates whether the transaction is a system transaction.
-
#mod_type ⇒ String
Describes the type of change.
-
#mods ⇒ Array<Google::Apis::SpannerV1::Mod>
Describes the changes that were made.
-
#number_of_partitions_in_transaction ⇒ Fixnum
Indicates the number of partitions that return data change records for this transaction.
-
#number_of_records_in_transaction ⇒ Fixnum
Indicates the number of data change records that are part of this transaction across all change stream partitions.
-
#record_sequence ⇒ String
Record sequence numbers are unique and monotonically increasing (but not necessarily contiguous) for a specific timestamp across record types in the same partition.
-
#server_transaction_id ⇒ String
Provides a globally unique string that represents the transaction in which the change was committed.
-
#table ⇒ String
Name of the table affected by the change.
-
#transaction_tag ⇒ String
Indicates the transaction tag associated with this transaction.
-
#value_capture_type ⇒ String
Describes the value capture type that was specified in the change stream configuration when this change was captured.
Instance Method Summary collapse
-
#initialize(**args) ⇒ DataChangeRecord
constructor
A new instance of DataChangeRecord.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ DataChangeRecord
Returns a new instance of DataChangeRecord.
2173 2174 2175 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2173 def initialize(**args) update!(**args) end |
Instance Attribute Details
#column_metadata ⇒ Array<Google::Apis::SpannerV1::ColumnMetadata>
Provides metadata describing the columns associated with the mods listed below.
Corresponds to the JSON property columnMetadata
2087 2088 2089 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2087 def @column_metadata end |
#commit_timestamp ⇒ String
Indicates the timestamp in which the change was committed. DataChangeRecord.
commit_timestamps, PartitionStartRecord.start_timestamps, PartitionEventRecord.
commit_timestamps, and PartitionEndRecord.end_timestamps can have the same
value in the same partition.
Corresponds to the JSON property commitTimestamp
2095 2096 2097 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2095 def @commit_timestamp end |
#is_last_record_in_transaction_in_partition ⇒ Boolean Also known as: is_last_record_in_transaction_in_partition?
Indicates whether this is the last record for a transaction in the current
partition. Clients can use this field to determine when all records for a
transaction in the current partition have been received.
Corresponds to the JSON property isLastRecordInTransactionInPartition
2102 2103 2104 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2102 def is_last_record_in_transaction_in_partition @is_last_record_in_transaction_in_partition end |
#is_system_transaction ⇒ Boolean Also known as: is_system_transaction?
Indicates whether the transaction is a system transaction. System transactions
include those issued by time-to-live (TTL), column backfill, etc.
Corresponds to the JSON property isSystemTransaction
2109 2110 2111 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2109 def is_system_transaction @is_system_transaction end |
#mod_type ⇒ String
Describes the type of change.
Corresponds to the JSON property modType
2115 2116 2117 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2115 def mod_type @mod_type end |
#mods ⇒ Array<Google::Apis::SpannerV1::Mod>
Describes the changes that were made.
Corresponds to the JSON property mods
2120 2121 2122 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2120 def mods @mods end |
#number_of_partitions_in_transaction ⇒ Fixnum
Indicates the number of partitions that return data change records for this
transaction. This value can be helpful in assembling all records associated
with a particular transaction.
Corresponds to the JSON property numberOfPartitionsInTransaction
2127 2128 2129 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2127 def number_of_partitions_in_transaction @number_of_partitions_in_transaction end |
#number_of_records_in_transaction ⇒ Fixnum
Indicates the number of data change records that are part of this transaction
across all change stream partitions. This value can be used to assemble all
the records associated with a particular transaction.
Corresponds to the JSON property numberOfRecordsInTransaction
2134 2135 2136 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2134 def number_of_records_in_transaction @number_of_records_in_transaction end |
#record_sequence ⇒ String
Record sequence numbers are unique and monotonically increasing (but not
necessarily contiguous) for a specific timestamp across record types in the
same partition. To guarantee ordered processing, the reader should process
records (of potentially different types) in record_sequence order for a
specific timestamp in the same partition. The record sequence number ordering
across partitions is only meaningful in the context of a specific transaction.
Record sequence numbers are unique across partitions for a specific
transaction. Sort the DataChangeRecords for the same server_transaction_id by
record_sequence to reconstruct the ordering of the changes within the
transaction.
Corresponds to the JSON property recordSequence
2148 2149 2150 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2148 def record_sequence @record_sequence end |
#server_transaction_id ⇒ String
Provides a globally unique string that represents the transaction in which the
change was committed. Multiple transactions can have the same commit timestamp,
but each transaction has a unique server_transaction_id.
Corresponds to the JSON property serverTransactionId
2155 2156 2157 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2155 def server_transaction_id @server_transaction_id end |
#table ⇒ String
Name of the table affected by the change.
Corresponds to the JSON property table
2160 2161 2162 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2160 def table @table end |
#transaction_tag ⇒ String
Indicates the transaction tag associated with this transaction.
Corresponds to the JSON property transactionTag
2165 2166 2167 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2165 def transaction_tag @transaction_tag end |
#value_capture_type ⇒ String
Describes the value capture type that was specified in the change stream
configuration when this change was captured.
Corresponds to the JSON property valueCaptureType
2171 2172 2173 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2171 def value_capture_type @value_capture_type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2178 def update!(**args) @column_metadata = args[:column_metadata] if args.key?(:column_metadata) @commit_timestamp = args[:commit_timestamp] if args.key?(:commit_timestamp) @is_last_record_in_transaction_in_partition = args[:is_last_record_in_transaction_in_partition] if args.key?(:is_last_record_in_transaction_in_partition) @is_system_transaction = args[:is_system_transaction] if args.key?(:is_system_transaction) @mod_type = args[:mod_type] if args.key?(:mod_type) @mods = args[:mods] if args.key?(:mods) @number_of_partitions_in_transaction = args[:number_of_partitions_in_transaction] if args.key?(:number_of_partitions_in_transaction) @number_of_records_in_transaction = args[:number_of_records_in_transaction] if args.key?(:number_of_records_in_transaction) @record_sequence = args[:record_sequence] if args.key?(:record_sequence) @server_transaction_id = args[:server_transaction_id] if args.key?(:server_transaction_id) @table = args[:table] if args.key?(:table) @transaction_tag = args[:transaction_tag] if args.key?(:transaction_tag) @value_capture_type = args[:value_capture_type] if args.key?(:value_capture_type) end |