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.



2006
2007
2008
# File 'lib/google/apis/spanner_v1/classes.rb', line 2006

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



1920
1921
1922
# File 'lib/google/apis/spanner_v1/classes.rb', line 1920

def 
  
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)


1928
1929
1930
# File 'lib/google/apis/spanner_v1/classes.rb', line 1928

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)


1935
1936
1937
# File 'lib/google/apis/spanner_v1/classes.rb', line 1935

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)


1942
1943
1944
# File 'lib/google/apis/spanner_v1/classes.rb', line 1942

def is_system_transaction
  @is_system_transaction
end

#mod_typeString

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

Returns:

  • (String)


1948
1949
1950
# File 'lib/google/apis/spanner_v1/classes.rb', line 1948

def mod_type
  @mod_type
end

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

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

Returns:



1953
1954
1955
# File 'lib/google/apis/spanner_v1/classes.rb', line 1953

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)


1960
1961
1962
# File 'lib/google/apis/spanner_v1/classes.rb', line 1960

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)


1967
1968
1969
# File 'lib/google/apis/spanner_v1/classes.rb', line 1967

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)


1981
1982
1983
# File 'lib/google/apis/spanner_v1/classes.rb', line 1981

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)


1988
1989
1990
# File 'lib/google/apis/spanner_v1/classes.rb', line 1988

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)


1993
1994
1995
# File 'lib/google/apis/spanner_v1/classes.rb', line 1993

def table
  @table
end

#transaction_tagString

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

Returns:

  • (String)


1998
1999
2000
# File 'lib/google/apis/spanner_v1/classes.rb', line 1998

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)


2004
2005
2006
# File 'lib/google/apis/spanner_v1/classes.rb', line 2004

def value_capture_type
  @value_capture_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
# File 'lib/google/apis/spanner_v1/classes.rb', line 2011

def update!(**args)
   = 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