google-cloud-spanner-v1 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e608332cd1e0b0cba1b9d9732838ee0e3fa11f6aebb171f7271b6803b036deb
|
4
|
+
data.tar.gz: 756c4e8410d25bde7101ad19a97369a16773d9fa969f7015ec4d54a266b2ba63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e92b09b178d9dcc879ebb0061dd08c6c033ebf548467b4f59e9a3c5afc40ac07b0f4959ae4f7fc2126327672d1c4cc3f324286250b86b3bdef64d3b26df0f5db
|
7
|
+
data.tar.gz: 7381402bead929b83052f1ed5003bd72526ff0e4ebd38eb7fcf3e263e4e3e60b59157db41b4288300c865eb078e8cc0e382060d94417968e89da73bce238b72e
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# source: google/spanner/v1/change_stream.proto
|
4
|
+
|
5
|
+
require 'google/protobuf'
|
6
|
+
|
7
|
+
require 'google/protobuf/struct_pb'
|
8
|
+
require 'google/protobuf/timestamp_pb'
|
9
|
+
require 'google/spanner/v1/type_pb'
|
10
|
+
|
11
|
+
|
12
|
+
descriptor_data = "\n%google/spanner/v1/change_stream.proto\x12\x11google.spanner.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/spanner/v1/type.proto\"\x96\x14\n\x12\x43hangeStreamRecord\x12T\n\x12\x64\x61ta_change_record\x18\x01 \x01(\x0b\x32\x36.google.spanner.v1.ChangeStreamRecord.DataChangeRecordH\x00\x12Q\n\x10heartbeat_record\x18\x02 \x01(\x0b\x32\x35.google.spanner.v1.ChangeStreamRecord.HeartbeatRecordH\x00\x12\\\n\x16partition_start_record\x18\x03 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionStartRecordH\x00\x12X\n\x14partition_end_record\x18\x04 \x01(\x0b\x32\x38.google.spanner.v1.ChangeStreamRecord.PartitionEndRecordH\x00\x12\\\n\x16partition_event_record\x18\x05 \x01(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.PartitionEventRecordH\x00\x1a\xd2\n\n\x10\x44\x61taChangeRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x1d\n\x15server_transaction_id\x18\x03 \x01(\t\x12\x32\n*is_last_record_in_transaction_in_partition\x18\x04 \x01(\x08\x12\r\n\x05table\x18\x05 \x01(\t\x12^\n\x0f\x63olumn_metadata\x18\x06 \x03(\x0b\x32\x45.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata\x12H\n\x04mods\x18\x07 \x03(\x0b\x32:.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod\x12P\n\x08mod_type\x18\x08 \x01(\x0e\x32>.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType\x12\x63\n\x12value_capture_type\x18\t \x01(\x0e\x32G.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType\x12(\n number_of_records_in_transaction\x18\n \x01(\x05\x12+\n#number_of_partitions_in_transaction\x18\x0b \x01(\x05\x12\x17\n\x0ftransaction_tag\x18\x0c \x01(\t\x12\x1d\n\x15is_system_transaction\x18\r \x01(\x08\x1aw\n\x0e\x43olumnMetadata\x12\x0c\n\x04name\x18\x01 \x01(\t\x12%\n\x04type\x18\x02 \x01(\x0b\x32\x17.google.spanner.v1.Type\x12\x16\n\x0eis_primary_key\x18\x03 \x01(\x08\x12\x18\n\x10ordinal_position\x18\x04 \x01(\x03\x1aP\n\x08ModValue\x12\x1d\n\x15\x63olumn_metadata_index\x18\x01 \x01(\x05\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\x1a\xfe\x01\n\x03Mod\x12M\n\x04keys\x18\x01 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nold_values\x18\x02 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\x12S\n\nnew_values\x18\x03 \x03(\x0b\x32?.google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue\"G\n\x07ModType\x12\x18\n\x14MOD_TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06INSERT\x10\n\x12\n\n\x06UPDATE\x10\x14\x12\n\n\x06\x44\x45LETE\x10\x1e\"\x87\x01\n\x10ValueCaptureType\x12\"\n\x1eVALUE_CAPTURE_TYPE_UNSPECIFIED\x10\x00\x12\x16\n\x12OLD_AND_NEW_VALUES\x10\n\x12\x0e\n\nNEW_VALUES\x10\x14\x12\x0b\n\x07NEW_ROW\x10\x1e\x12\x1a\n\x16NEW_ROW_AND_OLD_VALUES\x10(\x1a@\n\x0fHeartbeatRecord\x12-\n\ttimestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a~\n\x14PartitionStartRecord\x12\x33\n\x0fstart_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x18\n\x10partition_tokens\x18\x03 \x03(\t\x1ay\n\x12PartitionEndRecord\x12\x31\n\rend_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x1a\xa4\x03\n\x14PartitionEventRecord\x12\x34\n\x10\x63ommit_timestamp\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x17\n\x0frecord_sequence\x18\x02 \x01(\t\x12\x17\n\x0fpartition_token\x18\x03 \x01(\t\x12^\n\x0emove_in_events\x18\x04 \x03(\x0b\x32\x46.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent\x12`\n\x0fmove_out_events\x18\x05 \x03(\x0b\x32G.google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent\x1a-\n\x0bMoveInEvent\x12\x1e\n\x16source_partition_token\x18\x01 \x01(\t\x1a\x33\n\x0cMoveOutEvent\x12#\n\x1b\x64\x65stination_partition_token\x18\x01 \x01(\tB\x08\n\x06recordB\xb4\x01\n\x15\x63om.google.spanner.v1B\x11\x43hangeStreamProtoP\x01Z5cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb\xaa\x02\x17Google.Cloud.Spanner.V1\xca\x02\x17Google\\Cloud\\Spanner\\V1\xea\x02\x1aGoogle::Cloud::Spanner::V1b\x06proto3"
|
13
|
+
|
14
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
15
|
+
|
16
|
+
begin
|
17
|
+
pool.add_serialized_file(descriptor_data)
|
18
|
+
rescue TypeError
|
19
|
+
# Compatibility code: will be removed in the next major version.
|
20
|
+
require 'google/protobuf/descriptor_pb'
|
21
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
22
|
+
parsed.clear_dependency
|
23
|
+
serialized = parsed.class.encode(parsed)
|
24
|
+
file = pool.add_serialized_file(serialized)
|
25
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
26
|
+
imports = [
|
27
|
+
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
28
|
+
["google.spanner.v1.Type", "google/spanner/v1/type.proto"],
|
29
|
+
["google.protobuf.Value", "google/protobuf/struct.proto"],
|
30
|
+
]
|
31
|
+
imports.each do |type_name, expected_filename|
|
32
|
+
import_file = pool.lookup(type_name).file_descriptor
|
33
|
+
if import_file.name != expected_filename
|
34
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
38
|
+
warn "This will become an error in the next major version."
|
39
|
+
end
|
40
|
+
|
41
|
+
module Google
|
42
|
+
module Cloud
|
43
|
+
module Spanner
|
44
|
+
module V1
|
45
|
+
ChangeStreamRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord").msgclass
|
46
|
+
ChangeStreamRecord::DataChangeRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord").msgclass
|
47
|
+
ChangeStreamRecord::DataChangeRecord::ColumnMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ColumnMetadata").msgclass
|
48
|
+
ChangeStreamRecord::DataChangeRecord::ModValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModValue").msgclass
|
49
|
+
ChangeStreamRecord::DataChangeRecord::Mod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.Mod").msgclass
|
50
|
+
ChangeStreamRecord::DataChangeRecord::ModType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ModType").enummodule
|
51
|
+
ChangeStreamRecord::DataChangeRecord::ValueCaptureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.DataChangeRecord.ValueCaptureType").enummodule
|
52
|
+
ChangeStreamRecord::HeartbeatRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.HeartbeatRecord").msgclass
|
53
|
+
ChangeStreamRecord::PartitionStartRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionStartRecord").msgclass
|
54
|
+
ChangeStreamRecord::PartitionEndRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEndRecord").msgclass
|
55
|
+
ChangeStreamRecord::PartitionEventRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord").msgclass
|
56
|
+
ChangeStreamRecord::PartitionEventRecord::MoveInEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveInEvent").msgclass
|
57
|
+
ChangeStreamRecord::PartitionEventRecord::MoveOutEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ChangeStreamRecord.PartitionEventRecord.MoveOutEvent").msgclass
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,488 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2025 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Spanner
|
23
|
+
module V1
|
24
|
+
# Spanner Change Streams enable customers to capture and stream out changes to
|
25
|
+
# their Spanner databases in real-time. A change stream
|
26
|
+
# can be created with option partition_mode='IMMUTABLE_KEY_RANGE' or
|
27
|
+
# partition_mode='MUTABLE_KEY_RANGE'.
|
28
|
+
#
|
29
|
+
# This message is only used in Change Streams created with the option
|
30
|
+
# partition_mode='MUTABLE_KEY_RANGE'. Spanner automatically creates a special
|
31
|
+
# Table-Valued Function (TVF) along with each Change Streams. The function
|
32
|
+
# provides access to the change stream's records. The function is named
|
33
|
+
# READ_<change_stream_name> (where <change_stream_name> is the
|
34
|
+
# name of the change stream), and it returns a table with only one column
|
35
|
+
# called ChangeRecord.
|
36
|
+
# @!attribute [rw] data_change_record
|
37
|
+
# @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord]
|
38
|
+
# Data change record describing a data change for a change stream
|
39
|
+
# partition.
|
40
|
+
#
|
41
|
+
# Note: The following fields are mutually exclusive: `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
42
|
+
# @!attribute [rw] heartbeat_record
|
43
|
+
# @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::HeartbeatRecord]
|
44
|
+
# Heartbeat record describing a heartbeat for a change stream partition.
|
45
|
+
#
|
46
|
+
# Note: The following fields are mutually exclusive: `heartbeat_record`, `data_change_record`, `partition_start_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
47
|
+
# @!attribute [rw] partition_start_record
|
48
|
+
# @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionStartRecord]
|
49
|
+
# Partition start record describing a new change stream partition.
|
50
|
+
#
|
51
|
+
# Note: The following fields are mutually exclusive: `partition_start_record`, `data_change_record`, `heartbeat_record`, `partition_end_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
52
|
+
# @!attribute [rw] partition_end_record
|
53
|
+
# @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord]
|
54
|
+
# Partition end record describing a terminated change stream partition.
|
55
|
+
#
|
56
|
+
# Note: The following fields are mutually exclusive: `partition_end_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_event_record`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
57
|
+
# @!attribute [rw] partition_event_record
|
58
|
+
# @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord]
|
59
|
+
# Partition event record describing key range changes for a change stream
|
60
|
+
# partition.
|
61
|
+
#
|
62
|
+
# Note: The following fields are mutually exclusive: `partition_event_record`, `data_change_record`, `heartbeat_record`, `partition_start_record`, `partition_end_record`. If a field in that set is populated, all other fields in the set will automatically be cleared.
|
63
|
+
class ChangeStreamRecord
|
64
|
+
include ::Google::Protobuf::MessageExts
|
65
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
66
|
+
|
67
|
+
# A data change record contains a set of changes to a table with the same
|
68
|
+
# modification type (insert, update, or delete) committed at the same commit
|
69
|
+
# timestamp in one change stream partition for the same transaction. Multiple
|
70
|
+
# data change records can be returned for the same transaction across
|
71
|
+
# multiple change stream partitions.
|
72
|
+
# @!attribute [rw] commit_timestamp
|
73
|
+
# @return [::Google::Protobuf::Timestamp]
|
74
|
+
# Indicates the timestamp in which the change was committed.
|
75
|
+
# DataChangeRecord.commit_timestamps,
|
76
|
+
# PartitionStartRecord.start_timestamps,
|
77
|
+
# PartitionEventRecord.commit_timestamps, and
|
78
|
+
# PartitionEndRecord.end_timestamps can have the same value in the same
|
79
|
+
# partition.
|
80
|
+
# @!attribute [rw] record_sequence
|
81
|
+
# @return [::String]
|
82
|
+
# Record sequence numbers are unique and monotonically increasing (but not
|
83
|
+
# necessarily contiguous) for a specific timestamp across record
|
84
|
+
# types in the same partition. To guarantee ordered processing, the reader
|
85
|
+
# should process records (of potentially different types) in
|
86
|
+
# record_sequence order for a specific timestamp in the same partition.
|
87
|
+
#
|
88
|
+
# The record sequence number ordering across partitions is only meaningful
|
89
|
+
# in the context of a specific transaction. Record sequence numbers are
|
90
|
+
# unique across partitions for a specific transaction. Sort the
|
91
|
+
# DataChangeRecords for the same
|
92
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#server_transaction_id server_transaction_id}
|
93
|
+
# by
|
94
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#record_sequence record_sequence}
|
95
|
+
# to reconstruct the ordering of the changes within the transaction.
|
96
|
+
# @!attribute [rw] server_transaction_id
|
97
|
+
# @return [::String]
|
98
|
+
# Provides a globally unique string that represents the transaction in
|
99
|
+
# which the change was committed. Multiple transactions can have the same
|
100
|
+
# commit timestamp, but each transaction has a unique
|
101
|
+
# server_transaction_id.
|
102
|
+
# @!attribute [rw] is_last_record_in_transaction_in_partition
|
103
|
+
# @return [::Boolean]
|
104
|
+
# Indicates whether this is the last record for a transaction in the
|
105
|
+
# current partition. Clients can use this field to determine when all
|
106
|
+
# records for a transaction in the current partition have been received.
|
107
|
+
# @!attribute [rw] table
|
108
|
+
# @return [::String]
|
109
|
+
# Name of the table affected by the change.
|
110
|
+
# @!attribute [rw] column_metadata
|
111
|
+
# @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ColumnMetadata>]
|
112
|
+
# Provides metadata describing the columns associated with the
|
113
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#mods mods} listed
|
114
|
+
# below.
|
115
|
+
# @!attribute [rw] mods
|
116
|
+
# @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod>]
|
117
|
+
# Describes the changes that were made.
|
118
|
+
# @!attribute [rw] mod_type
|
119
|
+
# @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType]
|
120
|
+
# Describes the type of change.
|
121
|
+
# @!attribute [rw] value_capture_type
|
122
|
+
# @return [::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType]
|
123
|
+
# Describes the value capture type that was specified in the change stream
|
124
|
+
# configuration when this change was captured.
|
125
|
+
# @!attribute [rw] number_of_records_in_transaction
|
126
|
+
# @return [::Integer]
|
127
|
+
# Indicates the number of data change records that are part of this
|
128
|
+
# transaction across all change stream partitions. This value can be used
|
129
|
+
# to assemble all the records associated with a particular transaction.
|
130
|
+
# @!attribute [rw] number_of_partitions_in_transaction
|
131
|
+
# @return [::Integer]
|
132
|
+
# Indicates the number of partitions that return data change records for
|
133
|
+
# this transaction. This value can be helpful in assembling all records
|
134
|
+
# associated with a particular transaction.
|
135
|
+
# @!attribute [rw] transaction_tag
|
136
|
+
# @return [::String]
|
137
|
+
# Indicates the transaction tag associated with this transaction.
|
138
|
+
# @!attribute [rw] is_system_transaction
|
139
|
+
# @return [::Boolean]
|
140
|
+
# Indicates whether the transaction is a system transaction. System
|
141
|
+
# transactions include those issued by time-to-live (TTL), column backfill,
|
142
|
+
# etc.
|
143
|
+
class DataChangeRecord
|
144
|
+
include ::Google::Protobuf::MessageExts
|
145
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
146
|
+
|
147
|
+
# Metadata for a column.
|
148
|
+
# @!attribute [rw] name
|
149
|
+
# @return [::String]
|
150
|
+
# Name of the column.
|
151
|
+
# @!attribute [rw] type
|
152
|
+
# @return [::Google::Cloud::Spanner::V1::Type]
|
153
|
+
# Type of the column.
|
154
|
+
# @!attribute [rw] is_primary_key
|
155
|
+
# @return [::Boolean]
|
156
|
+
# Indicates whether the column is a primary key column.
|
157
|
+
# @!attribute [rw] ordinal_position
|
158
|
+
# @return [::Integer]
|
159
|
+
# Ordinal position of the column based on the original table definition
|
160
|
+
# in the schema starting with a value of 1.
|
161
|
+
class ColumnMetadata
|
162
|
+
include ::Google::Protobuf::MessageExts
|
163
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
164
|
+
end
|
165
|
+
|
166
|
+
# Returns the value and associated metadata for a particular field of the
|
167
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::Mod Mod}.
|
168
|
+
# @!attribute [rw] column_metadata_index
|
169
|
+
# @return [::Integer]
|
170
|
+
# Index within the repeated
|
171
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord#column_metadata column_metadata}
|
172
|
+
# field, to obtain the column metadata for the column that was modified.
|
173
|
+
# @!attribute [rw] value
|
174
|
+
# @return [::Google::Protobuf::Value]
|
175
|
+
# The value of the column.
|
176
|
+
class ModValue
|
177
|
+
include ::Google::Protobuf::MessageExts
|
178
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
179
|
+
end
|
180
|
+
|
181
|
+
# A mod describes all data changes in a watched table row.
|
182
|
+
# @!attribute [rw] keys
|
183
|
+
# @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>]
|
184
|
+
# Returns the value of the primary key of the modified row.
|
185
|
+
# @!attribute [rw] old_values
|
186
|
+
# @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>]
|
187
|
+
# Returns the old values before the change for the modified columns.
|
188
|
+
# Always empty for
|
189
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::INSERT INSERT},
|
190
|
+
# or if old values are not being captured specified by
|
191
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ValueCaptureType value_capture_type}.
|
192
|
+
# @!attribute [rw] new_values
|
193
|
+
# @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModValue>]
|
194
|
+
# Returns the new values after the change for the modified columns.
|
195
|
+
# Always empty for
|
196
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::DataChangeRecord::ModType::DELETE DELETE}.
|
197
|
+
class Mod
|
198
|
+
include ::Google::Protobuf::MessageExts
|
199
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
200
|
+
end
|
201
|
+
|
202
|
+
# Mod type describes the type of change Spanner applied to the data. For
|
203
|
+
# example, if the client submits an INSERT_OR_UPDATE request, Spanner will
|
204
|
+
# perform an insert if there is no existing row and return ModType INSERT.
|
205
|
+
# Alternatively, if there is an existing row, Spanner will perform an
|
206
|
+
# update and return ModType UPDATE.
|
207
|
+
module ModType
|
208
|
+
# Not specified.
|
209
|
+
MOD_TYPE_UNSPECIFIED = 0
|
210
|
+
|
211
|
+
# Indicates data was inserted.
|
212
|
+
INSERT = 10
|
213
|
+
|
214
|
+
# Indicates existing data was updated.
|
215
|
+
UPDATE = 20
|
216
|
+
|
217
|
+
# Indicates existing data was deleted.
|
218
|
+
DELETE = 30
|
219
|
+
end
|
220
|
+
|
221
|
+
# Value capture type describes which values are recorded in the data
|
222
|
+
# change record.
|
223
|
+
module ValueCaptureType
|
224
|
+
# Not specified.
|
225
|
+
VALUE_CAPTURE_TYPE_UNSPECIFIED = 0
|
226
|
+
|
227
|
+
# Records both old and new values of the modified watched columns.
|
228
|
+
OLD_AND_NEW_VALUES = 10
|
229
|
+
|
230
|
+
# Records only new values of the modified watched columns.
|
231
|
+
NEW_VALUES = 20
|
232
|
+
|
233
|
+
# Records new values of all watched columns, including modified and
|
234
|
+
# unmodified columns.
|
235
|
+
NEW_ROW = 30
|
236
|
+
|
237
|
+
# Records the new values of all watched columns, including modified and
|
238
|
+
# unmodified columns. Also records the old values of the modified
|
239
|
+
# columns.
|
240
|
+
NEW_ROW_AND_OLD_VALUES = 40
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
# A heartbeat record is returned as a progress indicator, when there are no
|
245
|
+
# data changes or any other partition record types in the change stream
|
246
|
+
# partition.
|
247
|
+
# @!attribute [rw] timestamp
|
248
|
+
# @return [::Google::Protobuf::Timestamp]
|
249
|
+
# Indicates the timestamp at which the query has returned all the records
|
250
|
+
# in the change stream partition with timestamp <= heartbeat timestamp.
|
251
|
+
# The heartbeat timestamp will not be the same as the timestamps of other
|
252
|
+
# record types in the same partition.
|
253
|
+
class HeartbeatRecord
|
254
|
+
include ::Google::Protobuf::MessageExts
|
255
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
256
|
+
end
|
257
|
+
|
258
|
+
# A partition start record serves as a notification that the client should
|
259
|
+
# schedule the partitions to be queried. PartitionStartRecord returns
|
260
|
+
# information about one or more partitions.
|
261
|
+
# @!attribute [rw] start_timestamp
|
262
|
+
# @return [::Google::Protobuf::Timestamp]
|
263
|
+
# Start timestamp at which the partitions should be queried to return
|
264
|
+
# change stream records with timestamps >= start_timestamp.
|
265
|
+
# DataChangeRecord.commit_timestamps,
|
266
|
+
# PartitionStartRecord.start_timestamps,
|
267
|
+
# PartitionEventRecord.commit_timestamps, and
|
268
|
+
# PartitionEndRecord.end_timestamps can have the same value in the same
|
269
|
+
# partition.
|
270
|
+
# @!attribute [rw] record_sequence
|
271
|
+
# @return [::String]
|
272
|
+
# Record sequence numbers are unique and monotonically increasing (but not
|
273
|
+
# necessarily contiguous) for a specific timestamp across record
|
274
|
+
# types in the same partition. To guarantee ordered processing, the reader
|
275
|
+
# should process records (of potentially different types) in
|
276
|
+
# record_sequence order for a specific timestamp in the same partition.
|
277
|
+
# @!attribute [rw] partition_tokens
|
278
|
+
# @return [::Array<::String>]
|
279
|
+
# Unique partition identifiers to be used in queries.
|
280
|
+
class PartitionStartRecord
|
281
|
+
include ::Google::Protobuf::MessageExts
|
282
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
283
|
+
end
|
284
|
+
|
285
|
+
# A partition end record serves as a notification that the client should stop
|
286
|
+
# reading the partition. No further records are expected to be retrieved on
|
287
|
+
# it.
|
288
|
+
# @!attribute [rw] end_timestamp
|
289
|
+
# @return [::Google::Protobuf::Timestamp]
|
290
|
+
# End timestamp at which the change stream partition is terminated. All
|
291
|
+
# changes generated by this partition will have timestamps <=
|
292
|
+
# end_timestamp. DataChangeRecord.commit_timestamps,
|
293
|
+
# PartitionStartRecord.start_timestamps,
|
294
|
+
# PartitionEventRecord.commit_timestamps, and
|
295
|
+
# PartitionEndRecord.end_timestamps can have the same value in the same
|
296
|
+
# partition. PartitionEndRecord is the last record returned for a
|
297
|
+
# partition.
|
298
|
+
# @!attribute [rw] record_sequence
|
299
|
+
# @return [::String]
|
300
|
+
# Record sequence numbers are unique and monotonically increasing (but not
|
301
|
+
# necessarily contiguous) for a specific timestamp across record
|
302
|
+
# types in the same partition. To guarantee ordered processing, the reader
|
303
|
+
# should process records (of potentially different types) in
|
304
|
+
# record_sequence order for a specific timestamp in the same partition.
|
305
|
+
# @!attribute [rw] partition_token
|
306
|
+
# @return [::String]
|
307
|
+
# Unique partition identifier describing the terminated change stream
|
308
|
+
# partition.
|
309
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEndRecord#partition_token partition_token}
|
310
|
+
# is equal to the partition token of the change stream partition currently
|
311
|
+
# queried to return this PartitionEndRecord.
|
312
|
+
class PartitionEndRecord
|
313
|
+
include ::Google::Protobuf::MessageExts
|
314
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
315
|
+
end
|
316
|
+
|
317
|
+
# A partition event record describes key range changes for a change stream
|
318
|
+
# partition. The changes to a row defined by its primary key can be captured
|
319
|
+
# in one change stream partition for a specific time range, and then be
|
320
|
+
# captured in a different change stream partition for a different time range.
|
321
|
+
# This movement of key ranges across change stream partitions is a reflection
|
322
|
+
# of activities, such as Spanner's dynamic splitting and load balancing, etc.
|
323
|
+
# Processing this event is needed if users want to guarantee processing of
|
324
|
+
# the changes for any key in timestamp order. If time ordered processing of
|
325
|
+
# changes for a primary key is not needed, this event can be ignored.
|
326
|
+
# To guarantee time ordered processing for each primary key, if the event
|
327
|
+
# describes move-ins, the reader of this partition needs to wait until the
|
328
|
+
# readers of the source partitions have processed all records with timestamps
|
329
|
+
# <= this PartitionEventRecord.commit_timestamp, before advancing beyond this
|
330
|
+
# PartitionEventRecord. If the event describes move-outs, the reader can
|
331
|
+
# notify the readers of the destination partitions that they can continue
|
332
|
+
# processing.
|
333
|
+
# @!attribute [rw] commit_timestamp
|
334
|
+
# @return [::Google::Protobuf::Timestamp]
|
335
|
+
# Indicates the commit timestamp at which the key range change occurred.
|
336
|
+
# DataChangeRecord.commit_timestamps,
|
337
|
+
# PartitionStartRecord.start_timestamps,
|
338
|
+
# PartitionEventRecord.commit_timestamps, and
|
339
|
+
# PartitionEndRecord.end_timestamps can have the same value in the same
|
340
|
+
# partition.
|
341
|
+
# @!attribute [rw] record_sequence
|
342
|
+
# @return [::String]
|
343
|
+
# Record sequence numbers are unique and monotonically increasing (but not
|
344
|
+
# necessarily contiguous) for a specific timestamp across record
|
345
|
+
# types in the same partition. To guarantee ordered processing, the reader
|
346
|
+
# should process records (of potentially different types) in
|
347
|
+
# record_sequence order for a specific timestamp in the same partition.
|
348
|
+
# @!attribute [rw] partition_token
|
349
|
+
# @return [::String]
|
350
|
+
# Unique partition identifier describing the partition this event
|
351
|
+
# occurred on.
|
352
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}
|
353
|
+
# is equal to the partition token of the change stream partition currently
|
354
|
+
# queried to return this PartitionEventRecord.
|
355
|
+
# @!attribute [rw] move_in_events
|
356
|
+
# @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveInEvent>]
|
357
|
+
# Set when one or more key ranges are moved into the change stream
|
358
|
+
# partition identified by
|
359
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}.
|
360
|
+
#
|
361
|
+
# Example: Two key ranges are moved into partition (P1) from partition (P2)
|
362
|
+
# and partition (P3) in a single transaction at timestamp T.
|
363
|
+
#
|
364
|
+
# The PartitionEventRecord returned in P1 will reflect the move as:
|
365
|
+
#
|
366
|
+
# PartitionEventRecord {
|
367
|
+
# commit_timestamp: T
|
368
|
+
# partition_token: "P1"
|
369
|
+
# move_in_events {
|
370
|
+
# source_partition_token: "P2"
|
371
|
+
# }
|
372
|
+
# move_in_events {
|
373
|
+
# source_partition_token: "P3"
|
374
|
+
# }
|
375
|
+
# }
|
376
|
+
#
|
377
|
+
# The PartitionEventRecord returned in P2 will reflect the move as:
|
378
|
+
#
|
379
|
+
# PartitionEventRecord {
|
380
|
+
# commit_timestamp: T
|
381
|
+
# partition_token: "P2"
|
382
|
+
# move_out_events {
|
383
|
+
# destination_partition_token: "P1"
|
384
|
+
# }
|
385
|
+
# }
|
386
|
+
#
|
387
|
+
# The PartitionEventRecord returned in P3 will reflect the move as:
|
388
|
+
#
|
389
|
+
# PartitionEventRecord {
|
390
|
+
# commit_timestamp: T
|
391
|
+
# partition_token: "P3"
|
392
|
+
# move_out_events {
|
393
|
+
# destination_partition_token: "P1"
|
394
|
+
# }
|
395
|
+
# }
|
396
|
+
# @!attribute [rw] move_out_events
|
397
|
+
# @return [::Array<::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent>]
|
398
|
+
# Set when one or more key ranges are moved out of the change stream
|
399
|
+
# partition identified by
|
400
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}.
|
401
|
+
#
|
402
|
+
# Example: Two key ranges are moved out of partition (P1) to partition (P2)
|
403
|
+
# and partition (P3) in a single transaction at timestamp T.
|
404
|
+
#
|
405
|
+
# The PartitionEventRecord returned in P1 will reflect the move as:
|
406
|
+
#
|
407
|
+
# PartitionEventRecord {
|
408
|
+
# commit_timestamp: T
|
409
|
+
# partition_token: "P1"
|
410
|
+
# move_out_events {
|
411
|
+
# destination_partition_token: "P2"
|
412
|
+
# }
|
413
|
+
# move_out_events {
|
414
|
+
# destination_partition_token: "P3"
|
415
|
+
# }
|
416
|
+
# }
|
417
|
+
#
|
418
|
+
# The PartitionEventRecord returned in P2 will reflect the move as:
|
419
|
+
#
|
420
|
+
# PartitionEventRecord {
|
421
|
+
# commit_timestamp: T
|
422
|
+
# partition_token: "P2"
|
423
|
+
# move_in_events {
|
424
|
+
# source_partition_token: "P1"
|
425
|
+
# }
|
426
|
+
# }
|
427
|
+
#
|
428
|
+
# The PartitionEventRecord returned in P3 will reflect the move as:
|
429
|
+
#
|
430
|
+
# PartitionEventRecord {
|
431
|
+
# commit_timestamp: T
|
432
|
+
# partition_token: "P3"
|
433
|
+
# move_in_events {
|
434
|
+
# source_partition_token: "P1"
|
435
|
+
# }
|
436
|
+
# }
|
437
|
+
class PartitionEventRecord
|
438
|
+
include ::Google::Protobuf::MessageExts
|
439
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
440
|
+
|
441
|
+
# Describes move-in of the key ranges into the change stream partition
|
442
|
+
# identified by
|
443
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}.
|
444
|
+
#
|
445
|
+
# To maintain processing the changes for a particular key in timestamp
|
446
|
+
# order, the query processing the change stream partition identified by
|
447
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}
|
448
|
+
# should not advance beyond the partition event record commit timestamp
|
449
|
+
# until the queries processing the source change stream partitions have
|
450
|
+
# processed all change stream records with timestamps <= the partition
|
451
|
+
# event record commit timestamp.
|
452
|
+
# @!attribute [rw] source_partition_token
|
453
|
+
# @return [::String]
|
454
|
+
# An unique partition identifier describing the source change stream
|
455
|
+
# partition that recorded changes for the key range that is moving
|
456
|
+
# into this partition.
|
457
|
+
class MoveInEvent
|
458
|
+
include ::Google::Protobuf::MessageExts
|
459
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
460
|
+
end
|
461
|
+
|
462
|
+
# Describes move-out of the key ranges out of the change stream partition
|
463
|
+
# identified by
|
464
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}.
|
465
|
+
#
|
466
|
+
# To maintain processing the changes for a particular key in timestamp
|
467
|
+
# order, the query processing the
|
468
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord::MoveOutEvent MoveOutEvent}
|
469
|
+
# in the partition identified by
|
470
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#partition_token partition_token}
|
471
|
+
# should inform the queries processing the destination partitions that
|
472
|
+
# they can unblock and proceed processing records past the
|
473
|
+
# {::Google::Cloud::Spanner::V1::ChangeStreamRecord::PartitionEventRecord#commit_timestamp commit_timestamp}.
|
474
|
+
# @!attribute [rw] destination_partition_token
|
475
|
+
# @return [::String]
|
476
|
+
# An unique partition identifier describing the destination change
|
477
|
+
# stream partition that will record changes for the key range that is
|
478
|
+
# moving out of this partition.
|
479
|
+
class MoveOutEvent
|
480
|
+
include ::Google::Protobuf::MessageExts
|
481
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
482
|
+
end
|
483
|
+
end
|
484
|
+
end
|
485
|
+
end
|
486
|
+
end
|
487
|
+
end
|
488
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-spanner-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
@@ -57,6 +57,7 @@ files:
|
|
57
57
|
- lib/google/cloud/spanner/v1/spanner/credentials.rb
|
58
58
|
- lib/google/cloud/spanner/v1/spanner/paths.rb
|
59
59
|
- lib/google/cloud/spanner/v1/version.rb
|
60
|
+
- lib/google/spanner/v1/change_stream_pb.rb
|
60
61
|
- lib/google/spanner/v1/commit_response_pb.rb
|
61
62
|
- lib/google/spanner/v1/keys_pb.rb
|
62
63
|
- lib/google/spanner/v1/mutation_pb.rb
|
@@ -77,6 +78,7 @@ files:
|
|
77
78
|
- proto_docs/google/protobuf/struct.rb
|
78
79
|
- proto_docs/google/protobuf/timestamp.rb
|
79
80
|
- proto_docs/google/rpc/status.rb
|
81
|
+
- proto_docs/google/spanner/v1/change_stream.rb
|
80
82
|
- proto_docs/google/spanner/v1/commit_response.rb
|
81
83
|
- proto_docs/google/spanner/v1/keys.rb
|
82
84
|
- proto_docs/google/spanner/v1/mutation.rb
|
@@ -103,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
105
|
- !ruby/object:Gem::Version
|
104
106
|
version: '0'
|
105
107
|
requirements: []
|
106
|
-
rubygems_version: 3.6.
|
108
|
+
rubygems_version: 3.6.9
|
107
109
|
specification_version: 4
|
108
110
|
summary: Cloud Spanner is a managed, mission-critical, globally consistent and scalable
|
109
111
|
relational database service.
|