Class: Google::Apis::SpannerV1::DataChangeRecord

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DataChangeRecord

Returns a new instance of DataChangeRecord.



2185
2186
2187
# File 'lib/google/apis/spanner_v1/classes.rb', line 2185

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#column_metadataArray<Google::Apis::SpannerV1::ColumnMetadata>

Provides metadata describing the columns associated with the mods listed below. Corresponds to the JSON property columnMetadata



2099
2100
2101
# File 'lib/google/apis/spanner_v1/classes.rb', line 2099

def 
  @column_metadata
end

#commit_timestampString

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

Returns:

  • (String)


2107
2108
2109
# File 'lib/google/apis/spanner_v1/classes.rb', line 2107

def commit_timestamp
  @commit_timestamp
end

#is_last_record_in_transaction_in_partitionBoolean 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

Returns:

  • (Boolean)


2114
2115
2116
# File 'lib/google/apis/spanner_v1/classes.rb', line 2114

def is_last_record_in_transaction_in_partition
  @is_last_record_in_transaction_in_partition
end

#is_system_transactionBoolean 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

Returns:

  • (Boolean)


2121
2122
2123
# File 'lib/google/apis/spanner_v1/classes.rb', line 2121

def is_system_transaction
  @is_system_transaction
end

#mod_typeString

Describes the type of change. Corresponds to the JSON property modType

Returns:

  • (String)


2127
2128
2129
# File 'lib/google/apis/spanner_v1/classes.rb', line 2127

def mod_type
  @mod_type
end

#modsArray<Google::Apis::SpannerV1::Mod>

Describes the changes that were made. Corresponds to the JSON property mods

Returns:



2132
2133
2134
# File 'lib/google/apis/spanner_v1/classes.rb', line 2132

def mods
  @mods
end

#number_of_partitions_in_transactionFixnum

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

Returns:

  • (Fixnum)


2139
2140
2141
# File 'lib/google/apis/spanner_v1/classes.rb', line 2139

def number_of_partitions_in_transaction
  @number_of_partitions_in_transaction
end

#number_of_records_in_transactionFixnum

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

Returns:

  • (Fixnum)


2146
2147
2148
# File 'lib/google/apis/spanner_v1/classes.rb', line 2146

def number_of_records_in_transaction
  @number_of_records_in_transaction
end

#record_sequenceString

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

Returns:

  • (String)


2160
2161
2162
# File 'lib/google/apis/spanner_v1/classes.rb', line 2160

def record_sequence
  @record_sequence
end

#server_transaction_idString

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

Returns:

  • (String)


2167
2168
2169
# File 'lib/google/apis/spanner_v1/classes.rb', line 2167

def server_transaction_id
  @server_transaction_id
end

#tableString

Name of the table affected by the change. Corresponds to the JSON property table

Returns:

  • (String)


2172
2173
2174
# File 'lib/google/apis/spanner_v1/classes.rb', line 2172

def table
  @table
end

#transaction_tagString

Indicates the transaction tag associated with this transaction. Corresponds to the JSON property transactionTag

Returns:

  • (String)


2177
2178
2179
# File 'lib/google/apis/spanner_v1/classes.rb', line 2177

def transaction_tag
  @transaction_tag
end

#value_capture_typeString

Describes the value capture type that was specified in the change stream configuration when this change was captured. Corresponds to the JSON property valueCaptureType

Returns:

  • (String)


2183
2184
2185
# File 'lib/google/apis/spanner_v1/classes.rb', line 2183

def value_capture_type
  @value_capture_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
# File 'lib/google/apis/spanner_v1/classes.rb', line 2190

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