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.
2081 2082 2083 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2081 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
1995 1996 1997 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 1995 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
2003 2004 2005 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2003 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
2010 2011 2012 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2010 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
2017 2018 2019 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2017 def is_system_transaction @is_system_transaction end |
#mod_type ⇒ String
Describes the type of change.
Corresponds to the JSON property modType
2023 2024 2025 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2023 def mod_type @mod_type end |
#mods ⇒ Array<Google::Apis::SpannerV1::Mod>
Describes the changes that were made.
Corresponds to the JSON property mods
2028 2029 2030 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2028 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
2035 2036 2037 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2035 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
2042 2043 2044 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2042 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
2056 2057 2058 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2056 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
2063 2064 2065 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2063 def server_transaction_id @server_transaction_id end |
#table ⇒ String
Name of the table affected by the change.
Corresponds to the JSON property table
2068 2069 2070 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2068 def table @table end |
#transaction_tag ⇒ String
Indicates the transaction tag associated with this transaction.
Corresponds to the JSON property transactionTag
2073 2074 2075 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2073 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
2079 2080 2081 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2079 def value_capture_type @value_capture_type end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 |
# File 'lib/google/apis/spanner_v1/classes.rb', line 2086 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 |