google-cloud-bigtable 0.1.3 → 0.2.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 +4 -4
- data/.yardopts +1 -0
- data/CHANGELOG.md +8 -0
- data/EMULATOR.md +30 -0
- data/OVERVIEW.md +2 -1
- data/lib/google-cloud-bigtable.rb +28 -22
- data/lib/google/cloud/bigtable.rb +25 -13
- data/lib/google/cloud/bigtable/admin/v2/bigtable_instance_admin_client_config.json +14 -14
- data/lib/google/cloud/bigtable/admin/v2/bigtable_table_admin_client_config.json +5 -5
- data/lib/google/cloud/bigtable/app_profile.rb +14 -14
- data/lib/google/cloud/bigtable/app_profile/list.rb +9 -9
- data/lib/google/cloud/bigtable/chunk_processor.rb +6 -6
- data/lib/google/cloud/bigtable/cluster.rb +5 -5
- data/lib/google/cloud/bigtable/cluster/job.rb +1 -1
- data/lib/google/cloud/bigtable/cluster/list.rb +6 -6
- data/lib/google/cloud/bigtable/column_family.rb +12 -12
- data/lib/google/cloud/bigtable/column_range.rb +8 -8
- data/lib/google/cloud/bigtable/gc_rule.rb +2 -2
- data/lib/google/cloud/bigtable/instance.rb +34 -36
- data/lib/google/cloud/bigtable/instance/cluster_map.rb +5 -5
- data/lib/google/cloud/bigtable/instance/list.rb +9 -9
- data/lib/google/cloud/bigtable/longrunning_job.rb +1 -1
- data/lib/google/cloud/bigtable/mutation_entry.rb +18 -18
- data/lib/google/cloud/bigtable/mutation_operations.rb +25 -23
- data/lib/google/cloud/bigtable/policy.rb +13 -13
- data/lib/google/cloud/bigtable/project.rb +27 -27
- data/lib/google/cloud/bigtable/read_modify_write_rule.rb +6 -6
- data/lib/google/cloud/bigtable/read_operations.rb +13 -13
- data/lib/google/cloud/bigtable/row.rb +7 -7
- data/lib/google/cloud/bigtable/row_filter.rb +58 -58
- data/lib/google/cloud/bigtable/row_filter/chain_filter.rb +40 -41
- data/lib/google/cloud/bigtable/row_filter/condition_filter.rb +6 -6
- data/lib/google/cloud/bigtable/row_filter/interleave_filter.rb +46 -47
- data/lib/google/cloud/bigtable/row_filter/simple_filter.rb +14 -15
- data/lib/google/cloud/bigtable/row_range.rb +16 -16
- data/lib/google/cloud/bigtable/rows_mutator.rb +5 -5
- data/lib/google/cloud/bigtable/rows_reader.rb +8 -9
- data/lib/google/cloud/bigtable/service.rb +153 -141
- data/lib/google/cloud/bigtable/table.rb +23 -23
- data/lib/google/cloud/bigtable/table/cluster_state.rb +2 -2
- data/lib/google/cloud/bigtable/table/column_family_map.rb +5 -5
- data/lib/google/cloud/bigtable/table/list.rb +8 -8
- data/lib/google/cloud/bigtable/value_range.rb +7 -7
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +5 -4
@@ -64,7 +64,7 @@ module Google
|
|
64
64
|
# The gRPC Service object.
|
65
65
|
attr_accessor :service
|
66
66
|
|
67
|
-
# @return [String] App profile
|
67
|
+
# @return [String] App profile ID for request routing.
|
68
68
|
attr_accessor :app_profile_id
|
69
69
|
|
70
70
|
# @private
|
@@ -110,7 +110,7 @@ module Google
|
|
110
110
|
#
|
111
111
|
# @param view [Symbol] Table view type.
|
112
112
|
# Default view type is `:SCHEMA_VIEW`
|
113
|
-
# Valid view types are
|
113
|
+
# Valid view types are:
|
114
114
|
#
|
115
115
|
# * `:NAME_ONLY` - Only populates `name`
|
116
116
|
# * `:SCHEMA_VIEW` - Only populates `name` and fields related to the table's schema
|
@@ -140,7 +140,7 @@ module Google
|
|
140
140
|
end
|
141
141
|
|
142
142
|
# The column families configured for this table, mapped by column family ID.
|
143
|
-
#
|
143
|
+
# Column-families data only available in table view types `SCHEMA_VIEW`, `FULL`.
|
144
144
|
#
|
145
145
|
#
|
146
146
|
# @return [Array<Google::Bigtable::ColumnFamily>]
|
@@ -170,7 +170,7 @@ module Google
|
|
170
170
|
@grpc.granularity
|
171
171
|
end
|
172
172
|
|
173
|
-
# The table keeps data versioned at a granularity of
|
173
|
+
# The table keeps data versioned at a granularity of 1 ms.
|
174
174
|
#
|
175
175
|
# @return [Boolean]
|
176
176
|
#
|
@@ -196,7 +196,7 @@ module Google
|
|
196
196
|
true
|
197
197
|
end
|
198
198
|
|
199
|
-
#
|
199
|
+
# Checks to see if the table exists.
|
200
200
|
#
|
201
201
|
# @return [Boolean]
|
202
202
|
#
|
@@ -213,7 +213,7 @@ module Google
|
|
213
213
|
# p "Table does not exist"
|
214
214
|
# end
|
215
215
|
#
|
216
|
-
# @example Using
|
216
|
+
# @example Using Cloud Bigtable instance
|
217
217
|
# require "google/cloud/bigtable"
|
218
218
|
#
|
219
219
|
# bigtable = Google::Cloud::Bigtable.new
|
@@ -292,7 +292,7 @@ module Google
|
|
292
292
|
)
|
293
293
|
end
|
294
294
|
|
295
|
-
#
|
295
|
+
# Applies multitple column modifications.
|
296
296
|
# Performs a series of column family modifications on the specified table.
|
297
297
|
# Either all or none of the modifications will occur before this method
|
298
298
|
# returns, but data requests received prior to that point may see a table
|
@@ -358,9 +358,9 @@ module Google
|
|
358
358
|
#
|
359
359
|
# @param service [Google::Cloud::Bigtable::Service]
|
360
360
|
# @param instance_id [String]
|
361
|
-
# The unique
|
361
|
+
# The unique ID of the instance the table is in.
|
362
362
|
# @param table_id [String]
|
363
|
-
# The unique
|
363
|
+
# The unique ID of the table whose families should be modified.
|
364
364
|
# @param modifications [Array<Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification> | Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification]
|
365
365
|
# Modifications to be atomically applied to the specified table's families.
|
366
366
|
# Entries are applied in order, meaning that earlier modifications can be
|
@@ -419,7 +419,7 @@ module Google
|
|
419
419
|
from_grpc(grpc, service)
|
420
420
|
end
|
421
421
|
|
422
|
-
# Generates a consistency token for a
|
422
|
+
# Generates a consistency token for a table. The token can be used in
|
423
423
|
# CheckConsistency to check whether mutations to the table that finished
|
424
424
|
# before this call started have been replicated. The tokens will be available
|
425
425
|
# for 90 days.
|
@@ -442,9 +442,9 @@ module Google
|
|
442
442
|
response.consistency_token
|
443
443
|
end
|
444
444
|
|
445
|
-
# Checks replication consistency based on a consistency token
|
446
|
-
# replication has caught up based on the conditions
|
447
|
-
# and the check request.
|
445
|
+
# Checks replication consistency based on a consistency token. Replication is
|
446
|
+
# considered consistent if replication has caught up based on the conditions
|
447
|
+
# specified in the token and the check request.
|
448
448
|
# @param token [String] Consistency token
|
449
449
|
# @return [Boolean] Replication is consistent or not.
|
450
450
|
#
|
@@ -470,7 +470,7 @@ module Google
|
|
470
470
|
|
471
471
|
# Wait for replication to check replication consistency.
|
472
472
|
# Checks replication consistency by generating a consistency token and
|
473
|
-
#
|
473
|
+
# making the `check_consistency` API call 5 times (by default).
|
474
474
|
# If the response is consistent, returns true. Otherwise tries again
|
475
475
|
# repeatedly until the timeout. If the check does not succeed by the
|
476
476
|
# timeout, returns `false`.
|
@@ -518,7 +518,7 @@ module Google
|
|
518
518
|
end
|
519
519
|
|
520
520
|
# @private
|
521
|
-
#
|
521
|
+
# Gets the data client instance.
|
522
522
|
#
|
523
523
|
# @return [Google::Cloud::Bigtable::V2::BigtableClient]
|
524
524
|
#
|
@@ -526,10 +526,10 @@ module Google
|
|
526
526
|
service.client
|
527
527
|
end
|
528
528
|
|
529
|
-
#
|
529
|
+
# Deletes all rows.
|
530
530
|
#
|
531
531
|
# @param timeout [Integer] Call timeout in seconds
|
532
|
-
# Use in case of
|
532
|
+
# Use in case of insufficient deadline for DropRowRange, then
|
533
533
|
# try again with a longer request deadline.
|
534
534
|
# @return [Boolean]
|
535
535
|
#
|
@@ -549,9 +549,9 @@ module Google
|
|
549
549
|
drop_row_range(delete_all_data: true, timeout: timeout)
|
550
550
|
end
|
551
551
|
|
552
|
-
#
|
552
|
+
# Deletes rows using row key prefix.
|
553
553
|
#
|
554
|
-
# @param prefix [String] Row key prefix
|
554
|
+
# @param prefix [String] Row key prefix (for example, "user")
|
555
555
|
# @param timeout [Integer] Call timeout in seconds
|
556
556
|
# @return [Boolean]
|
557
557
|
# @example
|
@@ -570,9 +570,9 @@ module Google
|
|
570
570
|
drop_row_range(row_key_prefix: prefix, timeout: timeout)
|
571
571
|
end
|
572
572
|
|
573
|
-
#
|
573
|
+
# Drops row range by row key prefix or deletes all.
|
574
574
|
#
|
575
|
-
# @param row_key_prefix [String] Row key prefix
|
575
|
+
# @param row_key_prefix [String] Row key prefix (for example, "user")
|
576
576
|
# @param delete_all_data [Boolean]
|
577
577
|
# @return [Boolean]
|
578
578
|
#
|
@@ -633,7 +633,7 @@ module Google
|
|
633
633
|
protected
|
634
634
|
|
635
635
|
# @private
|
636
|
-
#
|
636
|
+
# Raises an error unless an active connection to the service is
|
637
637
|
# available.
|
638
638
|
#
|
639
639
|
def ensure_service!
|
@@ -648,7 +648,7 @@ module Google
|
|
648
648
|
|
649
649
|
# @private
|
650
650
|
#
|
651
|
-
#
|
651
|
+
# Checks and reloads table with expected view and sets fields.
|
652
652
|
# @param view [Symbol] Expected view type.
|
653
653
|
#
|
654
654
|
def check_view_and_load view
|
@@ -19,12 +19,12 @@ module Google
|
|
19
19
|
module Cloud
|
20
20
|
module Bigtable
|
21
21
|
class Table
|
22
|
-
# Table::ClusterState is
|
22
|
+
# Table::ClusterState is the state of a table's data in a particular cluster.
|
23
23
|
class ClusterState
|
24
24
|
attr_reader :cluster_name
|
25
25
|
|
26
26
|
# @private
|
27
|
-
#
|
27
|
+
# Creates a new Table::ClusterState
|
28
28
|
#
|
29
29
|
def initialize grpc, cluster_name
|
30
30
|
@grpc = grpc
|
@@ -19,9 +19,9 @@ module Google
|
|
19
19
|
module Cloud
|
20
20
|
module Bigtable
|
21
21
|
class Table
|
22
|
-
# Table::ColumnFamilyMap is a
|
23
|
-
# It is used to create instance.
|
24
|
-
# @example Add column family with name and
|
22
|
+
# Table::ColumnFamilyMap is a hash accepting string `ColumnFamily` names as keys and `GcRule` objects as values.
|
23
|
+
# It is used to create an instance.
|
24
|
+
# @example Add column family with name and garbage collection rule
|
25
25
|
#
|
26
26
|
# column_families = Google::Cloud::Bigtable::Instance::ColumnFamilyMap.new
|
27
27
|
#
|
@@ -34,7 +34,7 @@ module Google
|
|
34
34
|
super(value)
|
35
35
|
end
|
36
36
|
|
37
|
-
#
|
37
|
+
# Adds a column family.
|
38
38
|
#
|
39
39
|
# @param name [String] Column family name
|
40
40
|
# @param gc_rule [Google::Bigtable::GcRule] GC Rule
|
@@ -53,7 +53,7 @@ module Google
|
|
53
53
|
)
|
54
54
|
end
|
55
55
|
|
56
|
-
#
|
56
|
+
# Removes a column family from the map.
|
57
57
|
#
|
58
58
|
# @param name [String] Column family name
|
59
59
|
# @return [Google::Bigtable::Admin::V2::ColumnFamily]
|
@@ -19,7 +19,7 @@ module Google
|
|
19
19
|
module Cloud
|
20
20
|
module Bigtable
|
21
21
|
class Table
|
22
|
-
# Table::List is a special
|
22
|
+
# Table::List is a special-case array with additional
|
23
23
|
# values.
|
24
24
|
class List < DelegateClass(::Array)
|
25
25
|
# @private
|
@@ -27,11 +27,11 @@ module Google
|
|
27
27
|
attr_accessor :service
|
28
28
|
|
29
29
|
# @private
|
30
|
-
# The gRPC page
|
30
|
+
# The gRPC page enumerable object.
|
31
31
|
attr_accessor :grpc
|
32
32
|
|
33
33
|
# @private
|
34
|
-
#
|
34
|
+
# Creates a new Table::List with an array of table instances.
|
35
35
|
def initialize arr = []
|
36
36
|
super(arr)
|
37
37
|
end
|
@@ -53,7 +53,7 @@ module Google
|
|
53
53
|
grpc.next_page?
|
54
54
|
end
|
55
55
|
|
56
|
-
#
|
56
|
+
# Retrieves the next page of tables.
|
57
57
|
#
|
58
58
|
# @return [Table::List] The list of table instances.
|
59
59
|
#
|
@@ -78,11 +78,11 @@ module Google
|
|
78
78
|
# {#next?} returns `false`. Calls the given block once for each
|
79
79
|
# result, which is passed as the argument to the block.
|
80
80
|
#
|
81
|
-
# An
|
81
|
+
# An enumerator is returned if no block is given.
|
82
82
|
#
|
83
83
|
# This method will make repeated API calls until all remaining results
|
84
|
-
# are retrieved
|
85
|
-
# over the results returned by a single API call.
|
84
|
+
# are retrieved (unlike `#each`, for example, which merely iterates
|
85
|
+
# over the results returned by a single API call). Use with caution.
|
86
86
|
#
|
87
87
|
# @yield [table] The block for accessing each table instance.
|
88
88
|
# @yieldparam [Table] instance The table instance object.
|
@@ -135,7 +135,7 @@ module Google
|
|
135
135
|
|
136
136
|
# @private
|
137
137
|
#
|
138
|
-
#
|
138
|
+
# Raises an error unless an active grpc call is available.
|
139
139
|
#
|
140
140
|
def ensure_grpc!
|
141
141
|
raise "Must have grpc call" unless grpc
|
@@ -22,10 +22,10 @@ module Google
|
|
22
22
|
#
|
23
23
|
# Specifies a contiguous range of string values.
|
24
24
|
#
|
25
|
-
# * from value bound : The value at which to
|
26
|
-
# If neither field is set, interpreted as
|
25
|
+
# * from value bound : The value at which to begin the range.
|
26
|
+
# If neither field is set, interpreted as an empty string, inclusive.
|
27
27
|
# * End value bound: The value at which to end the range.
|
28
|
-
# If neither field is set, interpreted as
|
28
|
+
# If neither field is set, interpreted as an infinite string value, exclusive.
|
29
29
|
#
|
30
30
|
# @example
|
31
31
|
# require "google/cloud/bigtable"
|
@@ -56,12 +56,12 @@ module Google
|
|
56
56
|
#
|
57
57
|
class ValueRange
|
58
58
|
# @private
|
59
|
-
#
|
59
|
+
# Creates a value range instance.
|
60
60
|
def initialize
|
61
61
|
@grpc = Google::Bigtable::V2::ValueRange.new
|
62
62
|
end
|
63
63
|
|
64
|
-
#
|
64
|
+
# Sets the row range with the lower bound.
|
65
65
|
#
|
66
66
|
# @param value [String] value. Required
|
67
67
|
# @param inclusive [String] Inclusive/Exclusive lower bound.
|
@@ -93,7 +93,7 @@ module Google
|
|
93
93
|
self
|
94
94
|
end
|
95
95
|
|
96
|
-
#
|
96
|
+
# Sets the value range with upper bound.
|
97
97
|
#
|
98
98
|
# @param value [String] value. Required
|
99
99
|
# @param inclusive [String] Inclusive/Exclusive upper bound.
|
@@ -125,7 +125,7 @@ module Google
|
|
125
125
|
self
|
126
126
|
end
|
127
127
|
|
128
|
-
#
|
128
|
+
# Sets the value range with the inclusive lower and upper bound.
|
129
129
|
#
|
130
130
|
# @param from_value [String] Inclusive from value. Required
|
131
131
|
# @param to_value [String] Inclusive end value. Required
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-bigtable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-gax
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
117
|
+
version: 0.59.2
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
124
|
+
version: 0.59.2
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: simplecov
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- CHANGELOG.md
|
176
176
|
- CODE_OF_CONDUCT.md
|
177
177
|
- CONTRIBUTING.md
|
178
|
+
- EMULATOR.md
|
178
179
|
- LICENSE
|
179
180
|
- LOGGING.md
|
180
181
|
- OVERVIEW.md
|