google-cloud-bigtable-v2 0.6.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/lib/google/bigtable/v2/bigtable_pb.rb +9 -0
- data/lib/google/bigtable/v2/request_stats_pb.rb +42 -0
- data/lib/google/bigtable/v2/response_params_pb.rb +23 -0
- data/lib/google/cloud/bigtable/v2/bigtable/client.rb +5 -3
- data/lib/google/cloud/bigtable/v2/version.rb +1 -1
- data/proto_docs/google/bigtable/v2/bigtable.rb +42 -2
- data/proto_docs/google/bigtable/v2/request_stats.rb +104 -0
- data/proto_docs/google/bigtable/v2/response_params.rb +42 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b488a55ed1e225be5451adb18dfc8738445870547b085792e064e8174e6071b
|
4
|
+
data.tar.gz: 6b48ff8142c4ee5e7ed9180597c16a4800a663514ce8946c626ac9539c65a2a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2522db32282c52ff18ed77baaa0e7612f4495b0adf964449703067494633f0a6df785931db8f3eddeb37ac7900bebf0de4c4fee80cdc3589630859b94f2c32f6
|
7
|
+
data.tar.gz: a30680ad0592b8e1dde4822ef8bafe539b5ba7d2c181fb6bc10df48dd7259cd33675da77a6c6a4dfbe0f32b13996ee840210e0cc21ea8be71e9c1417e13da2f8
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
@@ -9,6 +9,7 @@ require 'google/api/field_behavior_pb'
|
|
9
9
|
require 'google/api/resource_pb'
|
10
10
|
require 'google/api/routing_pb'
|
11
11
|
require 'google/bigtable/v2/data_pb'
|
12
|
+
require 'google/bigtable/v2/request_stats_pb'
|
12
13
|
require 'google/protobuf/wrappers_pb'
|
13
14
|
require 'google/rpc/status_pb'
|
14
15
|
|
@@ -20,10 +21,17 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
20
21
|
optional :rows, :message, 2, "google.bigtable.v2.RowSet"
|
21
22
|
optional :filter, :message, 3, "google.bigtable.v2.RowFilter"
|
22
23
|
optional :rows_limit, :int64, 4
|
24
|
+
optional :request_stats_view, :enum, 6, "google.bigtable.v2.ReadRowsRequest.RequestStatsView"
|
25
|
+
end
|
26
|
+
add_enum "google.bigtable.v2.ReadRowsRequest.RequestStatsView" do
|
27
|
+
value :REQUEST_STATS_VIEW_UNSPECIFIED, 0
|
28
|
+
value :REQUEST_STATS_NONE, 1
|
29
|
+
value :REQUEST_STATS_FULL, 2
|
23
30
|
end
|
24
31
|
add_message "google.bigtable.v2.ReadRowsResponse" do
|
25
32
|
repeated :chunks, :message, 1, "google.bigtable.v2.ReadRowsResponse.CellChunk"
|
26
33
|
optional :last_scanned_row_key, :bytes, 2
|
34
|
+
optional :request_stats, :message, 3, "google.bigtable.v2.RequestStats"
|
27
35
|
end
|
28
36
|
add_message "google.bigtable.v2.ReadRowsResponse.CellChunk" do
|
29
37
|
optional :row_key, :bytes, 1
|
@@ -104,6 +112,7 @@ module Google
|
|
104
112
|
module Bigtable
|
105
113
|
module V2
|
106
114
|
ReadRowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsRequest").msgclass
|
115
|
+
ReadRowsRequest::RequestStatsView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsRequest.RequestStatsView").enummodule
|
107
116
|
ReadRowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsResponse").msgclass
|
108
117
|
ReadRowsResponse::CellChunk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsResponse.CellChunk").msgclass
|
109
118
|
SampleRowKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.SampleRowKeysRequest").msgclass
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/bigtable/v2/request_stats.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/protobuf/duration_pb'
|
7
|
+
|
8
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
9
|
+
add_file("google/bigtable/v2/request_stats.proto", :syntax => :proto3) do
|
10
|
+
add_message "google.bigtable.v2.ReadIterationStats" do
|
11
|
+
optional :rows_seen_count, :int64, 1
|
12
|
+
optional :rows_returned_count, :int64, 2
|
13
|
+
optional :cells_seen_count, :int64, 3
|
14
|
+
optional :cells_returned_count, :int64, 4
|
15
|
+
end
|
16
|
+
add_message "google.bigtable.v2.RequestLatencyStats" do
|
17
|
+
optional :frontend_server_latency, :message, 1, "google.protobuf.Duration"
|
18
|
+
end
|
19
|
+
add_message "google.bigtable.v2.FullReadStatsView" do
|
20
|
+
optional :read_iteration_stats, :message, 1, "google.bigtable.v2.ReadIterationStats"
|
21
|
+
optional :request_latency_stats, :message, 2, "google.bigtable.v2.RequestLatencyStats"
|
22
|
+
end
|
23
|
+
add_message "google.bigtable.v2.RequestStats" do
|
24
|
+
oneof :stats_view do
|
25
|
+
optional :full_read_stats_view, :message, 1, "google.bigtable.v2.FullReadStatsView"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module Google
|
32
|
+
module Cloud
|
33
|
+
module Bigtable
|
34
|
+
module V2
|
35
|
+
ReadIterationStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadIterationStats").msgclass
|
36
|
+
RequestLatencyStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RequestLatencyStats").msgclass
|
37
|
+
FullReadStatsView = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.FullReadStatsView").msgclass
|
38
|
+
RequestStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RequestStats").msgclass
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/bigtable/v2/response_params.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
|
+
add_file("google/bigtable/v2/response_params.proto", :syntax => :proto3) do
|
8
|
+
add_message "google.bigtable.v2.ResponseParams" do
|
9
|
+
proto3_optional :zone_id, :string, 1
|
10
|
+
proto3_optional :cluster_id, :string, 2
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
module Bigtable
|
18
|
+
module V2
|
19
|
+
ResponseParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ResponseParams").msgclass
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -176,7 +176,7 @@ module Google
|
|
176
176
|
# @param options [::Gapic::CallOptions, ::Hash]
|
177
177
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
178
178
|
#
|
179
|
-
# @overload read_rows(table_name: nil, app_profile_id: nil, rows: nil, filter: nil, rows_limit: nil)
|
179
|
+
# @overload read_rows(table_name: nil, app_profile_id: nil, rows: nil, filter: nil, rows_limit: nil, request_stats_view: nil)
|
180
180
|
# Pass arguments to `read_rows` via keyword arguments. Note that at
|
181
181
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
182
182
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -186,8 +186,8 @@ module Google
|
|
186
186
|
# Values are of the form
|
187
187
|
# `projects/<project>/instances/<instance>/tables/<table>`.
|
188
188
|
# @param app_profile_id [::String]
|
189
|
-
# This value specifies routing for replication.
|
190
|
-
#
|
189
|
+
# This value specifies routing for replication. This API only accepts the
|
190
|
+
# empty value of app_profile_id.
|
191
191
|
# @param rows [::Google::Cloud::Bigtable::V2::RowSet, ::Hash]
|
192
192
|
# The row keys and/or ranges to read sequentially. If not specified, reads
|
193
193
|
# from all rows.
|
@@ -197,6 +197,8 @@ module Google
|
|
197
197
|
# @param rows_limit [::Integer]
|
198
198
|
# The read will stop after committing to N rows' worth of results. The
|
199
199
|
# default (zero) is to return all results.
|
200
|
+
# @param request_stats_view [::Google::Cloud::Bigtable::V2::ReadRowsRequest::RequestStatsView]
|
201
|
+
# The view into RequestStats, as described above.
|
200
202
|
#
|
201
203
|
# @yield [response, operation] Access the result along with the RPC operation
|
202
204
|
# @yieldparam response [::Enumerable<::Google::Cloud::Bigtable::V2::ReadRowsResponse>]
|
@@ -29,8 +29,8 @@ module Google
|
|
29
29
|
# `projects/<project>/instances/<instance>/tables/<table>`.
|
30
30
|
# @!attribute [rw] app_profile_id
|
31
31
|
# @return [::String]
|
32
|
-
# This value specifies routing for replication.
|
33
|
-
#
|
32
|
+
# This value specifies routing for replication. This API only accepts the
|
33
|
+
# empty value of app_profile_id.
|
34
34
|
# @!attribute [rw] rows
|
35
35
|
# @return [::Google::Cloud::Bigtable::V2::RowSet]
|
36
36
|
# The row keys and/or ranges to read sequentially. If not specified, reads
|
@@ -43,9 +43,28 @@ module Google
|
|
43
43
|
# @return [::Integer]
|
44
44
|
# The read will stop after committing to N rows' worth of results. The
|
45
45
|
# default (zero) is to return all results.
|
46
|
+
# @!attribute [rw] request_stats_view
|
47
|
+
# @return [::Google::Cloud::Bigtable::V2::ReadRowsRequest::RequestStatsView]
|
48
|
+
# The view into RequestStats, as described above.
|
46
49
|
class ReadRowsRequest
|
47
50
|
include ::Google::Protobuf::MessageExts
|
48
51
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
52
|
+
|
53
|
+
# The desired view into RequestStats that should be returned in the response.
|
54
|
+
#
|
55
|
+
# See also: RequestStats message.
|
56
|
+
module RequestStatsView
|
57
|
+
# The default / unset value. The API will default to the NONE option below.
|
58
|
+
REQUEST_STATS_VIEW_UNSPECIFIED = 0
|
59
|
+
|
60
|
+
# Do not include any RequestStats in the response. This will leave the
|
61
|
+
# RequestStats embedded message unset in the response.
|
62
|
+
REQUEST_STATS_NONE = 1
|
63
|
+
|
64
|
+
# Include the full set of available RequestStats in the response,
|
65
|
+
# applicable to this read.
|
66
|
+
REQUEST_STATS_FULL = 2
|
67
|
+
end
|
49
68
|
end
|
50
69
|
|
51
70
|
# Response message for Bigtable.ReadRows.
|
@@ -61,6 +80,27 @@ module Google
|
|
61
80
|
# This is primarily useful for cases where the server has read a
|
62
81
|
# lot of data that was filtered out since the last committed row
|
63
82
|
# key, allowing the client to skip that work on a retry.
|
83
|
+
# @!attribute [rw] request_stats
|
84
|
+
# @return [::Google::Cloud::Bigtable::V2::RequestStats]
|
85
|
+
# If requested, provide enhanced query performance statistics. The semantics
|
86
|
+
# dictate:
|
87
|
+
# * request_stats is empty on every (streamed) response, except
|
88
|
+
# * request_stats has non-empty information after all chunks have been
|
89
|
+
# streamed, where the ReadRowsResponse message only contains
|
90
|
+
# request_stats.
|
91
|
+
# * For example, if a read request would have returned an empty
|
92
|
+
# response instead a single ReadRowsResponse is streamed with empty
|
93
|
+
# chunks and request_stats filled.
|
94
|
+
#
|
95
|
+
# Visually, response messages will stream as follows:
|
96
|
+
# ... -> \\{chunks: [...]} -> \\{chunks: [], request_stats: \\{...}}
|
97
|
+
# \______________________/ \________________________________/
|
98
|
+
# Primary response Trailer of RequestStats info
|
99
|
+
#
|
100
|
+
# Or if the read did not return any values:
|
101
|
+
# \\{chunks: [], request_stats: \\{...}}
|
102
|
+
# \________________________________/
|
103
|
+
# Trailer of RequestStats info
|
64
104
|
class ReadRowsResponse
|
65
105
|
include ::Google::Protobuf::MessageExts
|
66
106
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -0,0 +1,104 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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 Bigtable
|
23
|
+
module V2
|
24
|
+
# ReadIterationStats captures information about the iteration of rows or cells
|
25
|
+
# over the course of a read, e.g. how many results were scanned in a read
|
26
|
+
# operation versus the results returned.
|
27
|
+
# @!attribute [rw] rows_seen_count
|
28
|
+
# @return [::Integer]
|
29
|
+
# The rows seen (scanned) as part of the request. This includes the count of
|
30
|
+
# rows returned, as captured below.
|
31
|
+
# @!attribute [rw] rows_returned_count
|
32
|
+
# @return [::Integer]
|
33
|
+
# The rows returned as part of the request.
|
34
|
+
# @!attribute [rw] cells_seen_count
|
35
|
+
# @return [::Integer]
|
36
|
+
# The cells seen (scanned) as part of the request. This includes the count of
|
37
|
+
# cells returned, as captured below.
|
38
|
+
# @!attribute [rw] cells_returned_count
|
39
|
+
# @return [::Integer]
|
40
|
+
# The cells returned as part of the request.
|
41
|
+
class ReadIterationStats
|
42
|
+
include ::Google::Protobuf::MessageExts
|
43
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
44
|
+
end
|
45
|
+
|
46
|
+
# RequestLatencyStats provides a measurement of the latency of the request as
|
47
|
+
# it interacts with different systems over its lifetime, e.g. how long the
|
48
|
+
# request took to execute within a frontend server.
|
49
|
+
# @!attribute [rw] frontend_server_latency
|
50
|
+
# @return [::Google::Protobuf::Duration]
|
51
|
+
# The latency measured by the frontend server handling this request, from
|
52
|
+
# when the request was received, to when this value is sent back in the
|
53
|
+
# response. For more context on the component that is measuring this latency,
|
54
|
+
# see: https://cloud.google.com/bigtable/docs/overview
|
55
|
+
#
|
56
|
+
# Note: This value may be slightly shorter than the value reported into
|
57
|
+
# aggregate latency metrics in Monitoring for this request
|
58
|
+
# (https://cloud.google.com/bigtable/docs/monitoring-instance) as this value
|
59
|
+
# needs to be sent in the response before the latency measurement including
|
60
|
+
# that transmission is finalized.
|
61
|
+
#
|
62
|
+
# Note: This value includes the end-to-end latency of contacting nodes in
|
63
|
+
# the targeted cluster, e.g. measuring from when the first byte arrives at
|
64
|
+
# the frontend server, to when this value is sent back as the last value in
|
65
|
+
# the response, including any latency incurred by contacting nodes, waiting
|
66
|
+
# for results from nodes, and finally sending results from nodes back to the
|
67
|
+
# caller.
|
68
|
+
class RequestLatencyStats
|
69
|
+
include ::Google::Protobuf::MessageExts
|
70
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
71
|
+
end
|
72
|
+
|
73
|
+
# FullReadStatsView captures all known information about a read.
|
74
|
+
# @!attribute [rw] read_iteration_stats
|
75
|
+
# @return [::Google::Cloud::Bigtable::V2::ReadIterationStats]
|
76
|
+
# Iteration stats describe how efficient the read is, e.g. comparing
|
77
|
+
# rows seen vs. rows returned or cells seen vs cells returned can provide an
|
78
|
+
# indication of read efficiency (the higher the ratio of seen to retuned the
|
79
|
+
# better).
|
80
|
+
# @!attribute [rw] request_latency_stats
|
81
|
+
# @return [::Google::Cloud::Bigtable::V2::RequestLatencyStats]
|
82
|
+
# Request latency stats describe the time taken to complete a request, from
|
83
|
+
# the server side.
|
84
|
+
class FullReadStatsView
|
85
|
+
include ::Google::Protobuf::MessageExts
|
86
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
87
|
+
end
|
88
|
+
|
89
|
+
# RequestStats is the container for additional information pertaining to a
|
90
|
+
# single request, helpful for evaluating the performance of the sent request.
|
91
|
+
# Currently, there are the following supported methods:
|
92
|
+
# * google.bigtable.v2.ReadRows
|
93
|
+
# @!attribute [rw] full_read_stats_view
|
94
|
+
# @return [::Google::Cloud::Bigtable::V2::FullReadStatsView]
|
95
|
+
# Available with the ReadRowsRequest.RequestStatsView.REQUEST_STATS_FULL
|
96
|
+
# view, see package google.bigtable.v2.
|
97
|
+
class RequestStats
|
98
|
+
include ::Google::Protobuf::MessageExts
|
99
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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 Bigtable
|
23
|
+
module V2
|
24
|
+
# Response metadata proto
|
25
|
+
# This is an experimental feature that will be used to get zone_id and
|
26
|
+
# cluster_id from response trailers to tag the metrics. This should not be
|
27
|
+
# used by customers directly
|
28
|
+
# @!attribute [rw] zone_id
|
29
|
+
# @return [::String]
|
30
|
+
# The cloud bigtable zone associated with the cluster.
|
31
|
+
# @!attribute [rw] cluster_id
|
32
|
+
# @return [::String]
|
33
|
+
# Identifier for a cluster that represents set of
|
34
|
+
# bigtable resources.
|
35
|
+
class ResponseParams
|
36
|
+
include ::Google::Protobuf::MessageExts
|
37
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 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 Protobuf
|
22
|
+
# A Duration represents a signed, fixed-length span of time represented
|
23
|
+
# as a count of seconds and fractions of seconds at nanosecond
|
24
|
+
# resolution. It is independent of any calendar and concepts like "day"
|
25
|
+
# or "month". It is related to Timestamp in that the difference between
|
26
|
+
# two Timestamp values is a Duration and it can be added or subtracted
|
27
|
+
# from a Timestamp. Range is approximately +-10,000 years.
|
28
|
+
#
|
29
|
+
# # Examples
|
30
|
+
#
|
31
|
+
# Example 1: Compute Duration from two Timestamps in pseudo code.
|
32
|
+
#
|
33
|
+
# Timestamp start = ...;
|
34
|
+
# Timestamp end = ...;
|
35
|
+
# Duration duration = ...;
|
36
|
+
#
|
37
|
+
# duration.seconds = end.seconds - start.seconds;
|
38
|
+
# duration.nanos = end.nanos - start.nanos;
|
39
|
+
#
|
40
|
+
# if (duration.seconds < 0 && duration.nanos > 0) {
|
41
|
+
# duration.seconds += 1;
|
42
|
+
# duration.nanos -= 1000000000;
|
43
|
+
# } else if (duration.seconds > 0 && duration.nanos < 0) {
|
44
|
+
# duration.seconds -= 1;
|
45
|
+
# duration.nanos += 1000000000;
|
46
|
+
# }
|
47
|
+
#
|
48
|
+
# Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
|
49
|
+
#
|
50
|
+
# Timestamp start = ...;
|
51
|
+
# Duration duration = ...;
|
52
|
+
# Timestamp end = ...;
|
53
|
+
#
|
54
|
+
# end.seconds = start.seconds + duration.seconds;
|
55
|
+
# end.nanos = start.nanos + duration.nanos;
|
56
|
+
#
|
57
|
+
# if (end.nanos < 0) {
|
58
|
+
# end.seconds -= 1;
|
59
|
+
# end.nanos += 1000000000;
|
60
|
+
# } else if (end.nanos >= 1000000000) {
|
61
|
+
# end.seconds += 1;
|
62
|
+
# end.nanos -= 1000000000;
|
63
|
+
# }
|
64
|
+
#
|
65
|
+
# Example 3: Compute Duration from datetime.timedelta in Python.
|
66
|
+
#
|
67
|
+
# td = datetime.timedelta(days=3, minutes=10)
|
68
|
+
# duration = Duration()
|
69
|
+
# duration.FromTimedelta(td)
|
70
|
+
#
|
71
|
+
# # JSON Mapping
|
72
|
+
#
|
73
|
+
# In JSON format, the Duration type is encoded as a string rather than an
|
74
|
+
# object, where the string ends in the suffix "s" (indicating seconds) and
|
75
|
+
# is preceded by the number of seconds, with nanoseconds expressed as
|
76
|
+
# fractional seconds. For example, 3 seconds with 0 nanoseconds should be
|
77
|
+
# encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
|
78
|
+
# be expressed in JSON format as "3.000000001s", and 3 seconds and 1
|
79
|
+
# microsecond should be expressed in JSON format as "3.000001s".
|
80
|
+
# @!attribute [rw] seconds
|
81
|
+
# @return [::Integer]
|
82
|
+
# Signed seconds of the span of time. Must be from -315,576,000,000
|
83
|
+
# to +315,576,000,000 inclusive. Note: these bounds are computed from:
|
84
|
+
# 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
|
85
|
+
# @!attribute [rw] nanos
|
86
|
+
# @return [::Integer]
|
87
|
+
# Signed fractions of a second at nanosecond resolution of the span
|
88
|
+
# of time. Durations less than one second are represented with a 0
|
89
|
+
# `seconds` field and a positive or negative `nanos` field. For durations
|
90
|
+
# of one second or more, a non-zero value for the `nanos` field must be
|
91
|
+
# of the same sign as the `seconds` field. Must be from -999,999,999
|
92
|
+
# to +999,999,999 inclusive.
|
93
|
+
class Duration
|
94
|
+
include ::Google::Protobuf::MessageExts
|
95
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-bigtable-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.12'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.12'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -173,6 +173,8 @@ files:
|
|
173
173
|
- lib/google/bigtable/v2/bigtable_pb.rb
|
174
174
|
- lib/google/bigtable/v2/bigtable_services_pb.rb
|
175
175
|
- lib/google/bigtable/v2/data_pb.rb
|
176
|
+
- lib/google/bigtable/v2/request_stats_pb.rb
|
177
|
+
- lib/google/bigtable/v2/response_params_pb.rb
|
176
178
|
- lib/google/cloud/bigtable/v2.rb
|
177
179
|
- lib/google/cloud/bigtable/v2/bigtable.rb
|
178
180
|
- lib/google/cloud/bigtable/v2/bigtable/client.rb
|
@@ -186,7 +188,10 @@ files:
|
|
186
188
|
- proto_docs/google/api/routing.rb
|
187
189
|
- proto_docs/google/bigtable/v2/bigtable.rb
|
188
190
|
- proto_docs/google/bigtable/v2/data.rb
|
191
|
+
- proto_docs/google/bigtable/v2/request_stats.rb
|
192
|
+
- proto_docs/google/bigtable/v2/response_params.rb
|
189
193
|
- proto_docs/google/protobuf/any.rb
|
194
|
+
- proto_docs/google/protobuf/duration.rb
|
190
195
|
- proto_docs/google/protobuf/wrappers.rb
|
191
196
|
- proto_docs/google/rpc/status.rb
|
192
197
|
homepage: https://github.com/googleapis/google-cloud-ruby
|