google-cloud-bigtable 1.2.2 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/lib/google/bigtable/admin/v2/bigtable_instance_admin_pb.rb +24 -24
- data/lib/google/bigtable/admin/v2/bigtable_instance_admin_services_pb.rb +59 -59
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_pb.rb +33 -33
- data/lib/google/bigtable/admin/v2/bigtable_table_admin_services_pb.rb +124 -124
- data/lib/google/bigtable/admin/v2/common_pb.rb +4 -4
- data/lib/google/bigtable/admin/v2/instance_pb.rb +10 -10
- data/lib/google/bigtable/admin/v2/table_pb.rb +18 -18
- data/lib/google/bigtable/v2/bigtable_pb.rb +17 -17
- data/lib/google/bigtable/v2/bigtable_services_pb.rb +39 -39
- data/lib/google/bigtable/v2/data_pb.rb +21 -21
- data/lib/google/cloud/bigtable/app_profile/list.rb +2 -2
- data/lib/google/cloud/bigtable/backup.rb +324 -0
- data/lib/google/cloud/bigtable/backup/job.rb +87 -0
- data/lib/google/cloud/bigtable/backup/list.rb +167 -0
- data/lib/google/cloud/bigtable/cluster.rb +99 -0
- data/lib/google/cloud/bigtable/cluster/list.rb +1 -1
- data/lib/google/cloud/bigtable/column_family_map.rb +1 -1
- data/lib/google/cloud/bigtable/instance/list.rb +1 -1
- data/lib/google/cloud/bigtable/longrunning_job.rb +11 -0
- data/lib/google/cloud/bigtable/service.rb +79 -0
- data/lib/google/cloud/bigtable/table/cluster_state.rb +25 -4
- data/lib/google/cloud/bigtable/table/list.rb +1 -1
- data/lib/google/cloud/bigtable/table/restore_job.rb +117 -0
- data/lib/google/cloud/bigtable/version.rb +1 -1
- metadata +7 -3
@@ -21,10 +21,10 @@ end
|
|
21
21
|
module Google
|
22
22
|
module Bigtable
|
23
23
|
module Admin
|
24
|
-
module V2
|
25
|
-
OperationProgress = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.OperationProgress").msgclass
|
26
|
-
StorageType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.StorageType").enummodule
|
27
|
-
end
|
28
24
|
end
|
29
25
|
end
|
30
26
|
end
|
27
|
+
module Google::Bigtable::Admin::V2
|
28
|
+
OperationProgress = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.OperationProgress").msgclass
|
29
|
+
StorageType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.StorageType").enummodule
|
30
|
+
end
|
@@ -59,16 +59,16 @@ end
|
|
59
59
|
module Google
|
60
60
|
module Bigtable
|
61
61
|
module Admin
|
62
|
-
module V2
|
63
|
-
Instance = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance").msgclass
|
64
|
-
Instance::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance.State").enummodule
|
65
|
-
Instance::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance.Type").enummodule
|
66
|
-
Cluster = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Cluster").msgclass
|
67
|
-
Cluster::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Cluster.State").enummodule
|
68
|
-
AppProfile = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile").msgclass
|
69
|
-
AppProfile::MultiClusterRoutingUseAny = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny").msgclass
|
70
|
-
AppProfile::SingleClusterRouting = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile.SingleClusterRouting").msgclass
|
71
|
-
end
|
72
62
|
end
|
73
63
|
end
|
74
64
|
end
|
65
|
+
module Google::Bigtable::Admin::V2
|
66
|
+
Instance = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance").msgclass
|
67
|
+
Instance::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance.State").enummodule
|
68
|
+
Instance::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Instance.Type").enummodule
|
69
|
+
Cluster = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Cluster").msgclass
|
70
|
+
Cluster::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Cluster.State").enummodule
|
71
|
+
AppProfile = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile").msgclass
|
72
|
+
AppProfile::MultiClusterRoutingUseAny = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile.MultiClusterRoutingUseAny").msgclass
|
73
|
+
AppProfile::SingleClusterRouting = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.AppProfile.SingleClusterRouting").msgclass
|
74
|
+
end
|
@@ -104,24 +104,24 @@ end
|
|
104
104
|
module Google
|
105
105
|
module Bigtable
|
106
106
|
module Admin
|
107
|
-
module V2
|
108
|
-
RestoreInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreInfo").msgclass
|
109
|
-
Table = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table").msgclass
|
110
|
-
Table::ClusterState = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.ClusterState").msgclass
|
111
|
-
Table::ClusterState::ReplicationState = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.ClusterState.ReplicationState").enummodule
|
112
|
-
Table::TimestampGranularity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.TimestampGranularity").enummodule
|
113
|
-
Table::View = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.View").enummodule
|
114
|
-
ColumnFamily = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.ColumnFamily").msgclass
|
115
|
-
GcRule = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule").msgclass
|
116
|
-
GcRule::Intersection = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule.Intersection").msgclass
|
117
|
-
GcRule::Union = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule.Union").msgclass
|
118
|
-
Snapshot = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot").msgclass
|
119
|
-
Snapshot::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot.State").enummodule
|
120
|
-
Backup = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Backup").msgclass
|
121
|
-
Backup::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Backup.State").enummodule
|
122
|
-
BackupInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.BackupInfo").msgclass
|
123
|
-
RestoreSourceType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreSourceType").enummodule
|
124
|
-
end
|
125
107
|
end
|
126
108
|
end
|
127
109
|
end
|
110
|
+
module Google::Bigtable::Admin::V2
|
111
|
+
RestoreInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreInfo").msgclass
|
112
|
+
Table = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table").msgclass
|
113
|
+
Table::ClusterState = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.ClusterState").msgclass
|
114
|
+
Table::ClusterState::ReplicationState = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.ClusterState.ReplicationState").enummodule
|
115
|
+
Table::TimestampGranularity = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.TimestampGranularity").enummodule
|
116
|
+
Table::View = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Table.View").enummodule
|
117
|
+
ColumnFamily = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.ColumnFamily").msgclass
|
118
|
+
GcRule = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule").msgclass
|
119
|
+
GcRule::Intersection = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule.Intersection").msgclass
|
120
|
+
GcRule::Union = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.GcRule.Union").msgclass
|
121
|
+
Snapshot = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot").msgclass
|
122
|
+
Snapshot::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Snapshot.State").enummodule
|
123
|
+
Backup = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Backup").msgclass
|
124
|
+
Backup::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.Backup.State").enummodule
|
125
|
+
BackupInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.BackupInfo").msgclass
|
126
|
+
RestoreSourceType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.admin.v2.RestoreSourceType").enummodule
|
127
|
+
end
|
@@ -92,22 +92,22 @@ end
|
|
92
92
|
|
93
93
|
module Google
|
94
94
|
module Bigtable
|
95
|
-
module V2
|
96
|
-
ReadRowsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsRequest").msgclass
|
97
|
-
ReadRowsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsResponse").msgclass
|
98
|
-
ReadRowsResponse::CellChunk = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsResponse.CellChunk").msgclass
|
99
|
-
SampleRowKeysRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.SampleRowKeysRequest").msgclass
|
100
|
-
SampleRowKeysResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.SampleRowKeysResponse").msgclass
|
101
|
-
MutateRowRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowRequest").msgclass
|
102
|
-
MutateRowResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowResponse").msgclass
|
103
|
-
MutateRowsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsRequest").msgclass
|
104
|
-
MutateRowsRequest::Entry = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsRequest.Entry").msgclass
|
105
|
-
MutateRowsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsResponse").msgclass
|
106
|
-
MutateRowsResponse::Entry = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsResponse.Entry").msgclass
|
107
|
-
CheckAndMutateRowRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.CheckAndMutateRowRequest").msgclass
|
108
|
-
CheckAndMutateRowResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.CheckAndMutateRowResponse").msgclass
|
109
|
-
ReadModifyWriteRowRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRowRequest").msgclass
|
110
|
-
ReadModifyWriteRowResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRowResponse").msgclass
|
111
|
-
end
|
112
95
|
end
|
113
96
|
end
|
97
|
+
module Google::Bigtable::V2
|
98
|
+
ReadRowsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsRequest").msgclass
|
99
|
+
ReadRowsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsResponse").msgclass
|
100
|
+
ReadRowsResponse::CellChunk = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadRowsResponse.CellChunk").msgclass
|
101
|
+
SampleRowKeysRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.SampleRowKeysRequest").msgclass
|
102
|
+
SampleRowKeysResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.SampleRowKeysResponse").msgclass
|
103
|
+
MutateRowRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowRequest").msgclass
|
104
|
+
MutateRowResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowResponse").msgclass
|
105
|
+
MutateRowsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsRequest").msgclass
|
106
|
+
MutateRowsRequest::Entry = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsRequest.Entry").msgclass
|
107
|
+
MutateRowsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsResponse").msgclass
|
108
|
+
MutateRowsResponse::Entry = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.MutateRowsResponse.Entry").msgclass
|
109
|
+
CheckAndMutateRowRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.CheckAndMutateRowRequest").msgclass
|
110
|
+
CheckAndMutateRowResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.CheckAndMutateRowResponse").msgclass
|
111
|
+
ReadModifyWriteRowRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRowRequest").msgclass
|
112
|
+
ReadModifyWriteRowResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRowResponse").msgclass
|
113
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# Source: google/bigtable/v2/bigtable.proto for package '
|
2
|
+
# Source: google/bigtable/v2/bigtable.proto for package 'Google::Cloud::Bigtable::V2'
|
3
3
|
# Original file comments:
|
4
4
|
# Copyright 2019 Google LLC.
|
5
5
|
#
|
@@ -22,47 +22,47 @@ require 'google/bigtable/v2/bigtable_pb'
|
|
22
22
|
|
23
23
|
module Google
|
24
24
|
module Bigtable
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
end
|
26
|
+
end
|
27
|
+
module Google::Bigtable::V2
|
28
|
+
module Bigtable
|
29
|
+
# Service for reading from and writing to existing Bigtable tables.
|
30
|
+
class Service
|
31
31
|
|
32
|
-
|
33
|
-
self.unmarshal_class_method = :decode
|
34
|
-
self.service_name = 'google.bigtable.v2.Bigtable'
|
32
|
+
include GRPC::GenericService
|
35
33
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
# atomicity of each row will still be preserved. See the
|
40
|
-
# ReadRowsResponse documentation for details.
|
41
|
-
rpc :ReadRows, ReadRowsRequest, stream(ReadRowsResponse)
|
42
|
-
# Returns a sample of row keys in the table. The returned row keys will
|
43
|
-
# delimit contiguous sections of the table of approximately equal size,
|
44
|
-
# which can be used to break up the data for distributed tasks like
|
45
|
-
# mapreduces.
|
46
|
-
rpc :SampleRowKeys, SampleRowKeysRequest, stream(SampleRowKeysResponse)
|
47
|
-
# Mutates a row atomically. Cells already present in the row are left
|
48
|
-
# unchanged unless explicitly changed by `mutation`.
|
49
|
-
rpc :MutateRow, MutateRowRequest, MutateRowResponse
|
50
|
-
# Mutates multiple rows in a batch. Each individual row is mutated
|
51
|
-
# atomically as in MutateRow, but the entire batch is not executed
|
52
|
-
# atomically.
|
53
|
-
rpc :MutateRows, MutateRowsRequest, stream(MutateRowsResponse)
|
54
|
-
# Mutates a row atomically based on the output of a predicate Reader filter.
|
55
|
-
rpc :CheckAndMutateRow, CheckAndMutateRowRequest, CheckAndMutateRowResponse
|
56
|
-
# Modifies a row atomically on the server. The method reads the latest
|
57
|
-
# existing timestamp and value from the specified columns and writes a new
|
58
|
-
# entry based on pre-defined read/modify/write rules. The new value for the
|
59
|
-
# timestamp is the greater of the existing timestamp or the current server
|
60
|
-
# time. The method returns the new contents of all modified cells.
|
61
|
-
rpc :ReadModifyWriteRow, ReadModifyWriteRowRequest, ReadModifyWriteRowResponse
|
62
|
-
end
|
34
|
+
self.marshal_class_method = :encode
|
35
|
+
self.unmarshal_class_method = :decode
|
36
|
+
self.service_name = 'google.bigtable.v2.Bigtable'
|
63
37
|
|
64
|
-
|
65
|
-
|
38
|
+
# Streams back the contents of all requested rows in key order, optionally
|
39
|
+
# applying the same Reader filter to each. Depending on their size,
|
40
|
+
# rows and cells may be broken up across multiple responses, but
|
41
|
+
# atomicity of each row will still be preserved. See the
|
42
|
+
# ReadRowsResponse documentation for details.
|
43
|
+
rpc :ReadRows, ReadRowsRequest, stream(ReadRowsResponse)
|
44
|
+
# Returns a sample of row keys in the table. The returned row keys will
|
45
|
+
# delimit contiguous sections of the table of approximately equal size,
|
46
|
+
# which can be used to break up the data for distributed tasks like
|
47
|
+
# mapreduces.
|
48
|
+
rpc :SampleRowKeys, SampleRowKeysRequest, stream(SampleRowKeysResponse)
|
49
|
+
# Mutates a row atomically. Cells already present in the row are left
|
50
|
+
# unchanged unless explicitly changed by `mutation`.
|
51
|
+
rpc :MutateRow, MutateRowRequest, MutateRowResponse
|
52
|
+
# Mutates multiple rows in a batch. Each individual row is mutated
|
53
|
+
# atomically as in MutateRow, but the entire batch is not executed
|
54
|
+
# atomically.
|
55
|
+
rpc :MutateRows, MutateRowsRequest, stream(MutateRowsResponse)
|
56
|
+
# Mutates a row atomically based on the output of a predicate Reader filter.
|
57
|
+
rpc :CheckAndMutateRow, CheckAndMutateRowRequest, CheckAndMutateRowResponse
|
58
|
+
# Modifies a row atomically on the server. The method reads the latest
|
59
|
+
# existing timestamp and value from the specified columns and writes a new
|
60
|
+
# entry based on pre-defined read/modify/write rules. The new value for the
|
61
|
+
# timestamp is the greater of the existing timestamp or the current server
|
62
|
+
# time. The method returns the new contents of all modified cells.
|
63
|
+
rpc :ReadModifyWriteRow, ReadModifyWriteRowRequest, ReadModifyWriteRowResponse
|
66
64
|
end
|
65
|
+
|
66
|
+
Stub = Service.rpc_stub_class
|
67
67
|
end
|
68
68
|
end
|
@@ -131,26 +131,26 @@ end
|
|
131
131
|
|
132
132
|
module Google
|
133
133
|
module Bigtable
|
134
|
-
module V2
|
135
|
-
Row = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Row").msgclass
|
136
|
-
Family = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Family").msgclass
|
137
|
-
Column = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Column").msgclass
|
138
|
-
Cell = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Cell").msgclass
|
139
|
-
RowRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowRange").msgclass
|
140
|
-
RowSet = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowSet").msgclass
|
141
|
-
ColumnRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ColumnRange").msgclass
|
142
|
-
TimestampRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.TimestampRange").msgclass
|
143
|
-
ValueRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ValueRange").msgclass
|
144
|
-
RowFilter = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter").msgclass
|
145
|
-
RowFilter::Chain = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter.Chain").msgclass
|
146
|
-
RowFilter::Interleave = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter.Interleave").msgclass
|
147
|
-
RowFilter::Condition = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter.Condition").msgclass
|
148
|
-
Mutation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation").msgclass
|
149
|
-
Mutation::SetCell = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.SetCell").msgclass
|
150
|
-
Mutation::DeleteFromColumn = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.DeleteFromColumn").msgclass
|
151
|
-
Mutation::DeleteFromFamily = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.DeleteFromFamily").msgclass
|
152
|
-
Mutation::DeleteFromRow = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.DeleteFromRow").msgclass
|
153
|
-
ReadModifyWriteRule = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRule").msgclass
|
154
|
-
end
|
155
134
|
end
|
156
135
|
end
|
136
|
+
module Google::Bigtable::V2
|
137
|
+
Row = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Row").msgclass
|
138
|
+
Family = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Family").msgclass
|
139
|
+
Column = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Column").msgclass
|
140
|
+
Cell = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Cell").msgclass
|
141
|
+
RowRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowRange").msgclass
|
142
|
+
RowSet = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowSet").msgclass
|
143
|
+
ColumnRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ColumnRange").msgclass
|
144
|
+
TimestampRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.TimestampRange").msgclass
|
145
|
+
ValueRange = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ValueRange").msgclass
|
146
|
+
RowFilter = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter").msgclass
|
147
|
+
RowFilter::Chain = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter.Chain").msgclass
|
148
|
+
RowFilter::Interleave = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter.Interleave").msgclass
|
149
|
+
RowFilter::Condition = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.RowFilter.Condition").msgclass
|
150
|
+
Mutation = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation").msgclass
|
151
|
+
Mutation::SetCell = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.SetCell").msgclass
|
152
|
+
Mutation::DeleteFromColumn = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.DeleteFromColumn").msgclass
|
153
|
+
Mutation::DeleteFromFamily = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.DeleteFromFamily").msgclass
|
154
|
+
Mutation::DeleteFromRow = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.Mutation.DeleteFromRow").msgclass
|
155
|
+
ReadModifyWriteRule = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.bigtable.v2.ReadModifyWriteRule").msgclass
|
156
|
+
end
|
@@ -97,7 +97,7 @@ module Google
|
|
97
97
|
# @yield [app_profile] The block for accessing each app profile.
|
98
98
|
# @yieldparam [AppProfile] app_profile The app profile object.
|
99
99
|
#
|
100
|
-
# @return [Enumerator]
|
100
|
+
# @return [Enumerator,nil] An enumerator is returned if no block is given, otherwise `nil`.
|
101
101
|
#
|
102
102
|
# @example Iterating each app profile by passing a block:
|
103
103
|
# require "google/cloud/bigtable"
|
@@ -118,7 +118,7 @@ module Google
|
|
118
118
|
#
|
119
119
|
# instance = bigtable.instance("my-instance")
|
120
120
|
#
|
121
|
-
#
|
121
|
+
# all_app_profile_ids = instance.app_profiles.all.map do |app_profile|
|
122
122
|
# app_profile.name
|
123
123
|
# end
|
124
124
|
#
|
@@ -0,0 +1,324 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2020 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
|
+
|
18
|
+
require "google/cloud/bigtable/backup/job"
|
19
|
+
require "google/cloud/bigtable/backup/list"
|
20
|
+
require "google/cloud/bigtable/convert"
|
21
|
+
require "google/cloud/bigtable/table/restore_job"
|
22
|
+
|
23
|
+
|
24
|
+
module Google
|
25
|
+
module Cloud
|
26
|
+
module Bigtable
|
27
|
+
##
|
28
|
+
# # Backup
|
29
|
+
#
|
30
|
+
# A backup of a Cloud Bigtable table. See {Cluster#create_backup}, {Cluster#backup} and {Cluster#backups}.
|
31
|
+
#
|
32
|
+
# @example
|
33
|
+
# require "google/cloud/bigtable"
|
34
|
+
#
|
35
|
+
# bigtable = Google::Cloud::Bigtable.new
|
36
|
+
# instance = bigtable.instance("my-instance")
|
37
|
+
# cluster = instance.cluster("my-cluster")
|
38
|
+
#
|
39
|
+
# backup = cluster.backup("my-backup")
|
40
|
+
#
|
41
|
+
# # Update
|
42
|
+
# backup.expire_time = Time.now + 60 * 60 * 7
|
43
|
+
# backup.save
|
44
|
+
#
|
45
|
+
# # Delete
|
46
|
+
# backup.delete
|
47
|
+
#
|
48
|
+
class Backup
|
49
|
+
# @private
|
50
|
+
# The gRPC Service object.
|
51
|
+
attr_accessor :service
|
52
|
+
|
53
|
+
##
|
54
|
+
# @private A list of attributes that were updated.
|
55
|
+
attr_reader :updates
|
56
|
+
|
57
|
+
# @private
|
58
|
+
#
|
59
|
+
# Creates a new Backup instance.
|
60
|
+
def initialize grpc, service
|
61
|
+
@grpc = grpc
|
62
|
+
@service = service
|
63
|
+
end
|
64
|
+
|
65
|
+
##
|
66
|
+
# The unique identifier for the project to which the backup belongs.
|
67
|
+
#
|
68
|
+
# @return [String]
|
69
|
+
#
|
70
|
+
def project_id
|
71
|
+
@grpc.name.split("/")[1]
|
72
|
+
end
|
73
|
+
|
74
|
+
##
|
75
|
+
# The unique identifier for the instance to which the backup belongs.
|
76
|
+
#
|
77
|
+
# @return [String]
|
78
|
+
#
|
79
|
+
def instance_id
|
80
|
+
@grpc.name.split("/")[3]
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# The unique identifier for the cluster to which the backup belongs.
|
85
|
+
#
|
86
|
+
# @return [String]
|
87
|
+
#
|
88
|
+
def cluster_id
|
89
|
+
@grpc.name.split("/")[5]
|
90
|
+
end
|
91
|
+
|
92
|
+
##
|
93
|
+
# The unique identifier for the backup.
|
94
|
+
#
|
95
|
+
# @return [String]
|
96
|
+
#
|
97
|
+
def backup_id
|
98
|
+
@grpc.name.split("/")[7]
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# The unique name of the backup. Value in the form
|
103
|
+
# `projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>`.
|
104
|
+
#
|
105
|
+
# @return [String]
|
106
|
+
#
|
107
|
+
def path
|
108
|
+
@grpc.name
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# The table from which this backup was created.
|
113
|
+
#
|
114
|
+
# @param perform_lookup [Boolean] Creates table object without verifying that the table resource exists. Calls
|
115
|
+
# made on this object will raise errors if the table does not exist. Default value is `false`. Optional. Helps
|
116
|
+
# to reduce admin API calls.
|
117
|
+
# @param view [Symbol] Table view type. Default view type is `:SCHEMA_VIEW`. Valid view types are:
|
118
|
+
#
|
119
|
+
# * `:NAME_ONLY` - Only populates `name`.
|
120
|
+
# * `:SCHEMA_VIEW` - Only populates `name` and fields related to the table's schema.
|
121
|
+
# * `:REPLICATION_VIEW` - Only populates `name` and fields related to the table's replication state.
|
122
|
+
# * `:FULL` - Populates all fields.
|
123
|
+
#
|
124
|
+
# @return [Table]
|
125
|
+
#
|
126
|
+
def source_table perform_lookup: nil, view: nil
|
127
|
+
table = Table.from_path @grpc.source_table, service
|
128
|
+
return table.reload! view: view if perform_lookup
|
129
|
+
table
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# The expiration time of the backup, with microseconds granularity that must be at least 6 hours and at most 30
|
134
|
+
# days from the time the request is received. Once the expire time has passed, Cloud Bigtable will delete the
|
135
|
+
# backup and free the resources used by the backup.
|
136
|
+
#
|
137
|
+
# @return [Time]
|
138
|
+
#
|
139
|
+
def expire_time
|
140
|
+
Convert.timestamp_to_time @grpc.expire_time
|
141
|
+
end
|
142
|
+
|
143
|
+
##
|
144
|
+
# Sets the expiration time of the backup, with microseconds granularity that must be at least 6 hours and at
|
145
|
+
# most 30 days from the time the request is received. Once the {#expire_time} has passed, Cloud Bigtable will
|
146
|
+
# delete the backup and free the resources used by the backup.
|
147
|
+
#
|
148
|
+
# @param [Time] new_expire_time The new expiration time of the backup.
|
149
|
+
#
|
150
|
+
def expire_time= new_expire_time
|
151
|
+
@grpc.expire_time = Convert.time_to_timestamp new_expire_time
|
152
|
+
end
|
153
|
+
|
154
|
+
##
|
155
|
+
# The time that the backup was started (i.e. approximately the time the `CreateBackup` request is received). The
|
156
|
+
# row data in this backup will be no older than this timestamp.
|
157
|
+
#
|
158
|
+
# @return [Time]
|
159
|
+
#
|
160
|
+
def start_time
|
161
|
+
Convert.timestamp_to_time @grpc.start_time
|
162
|
+
end
|
163
|
+
|
164
|
+
##
|
165
|
+
# The time that the backup was finished. The row data in the backup will be no newer than this timestamp.
|
166
|
+
#
|
167
|
+
# @return [Time]
|
168
|
+
#
|
169
|
+
def end_time
|
170
|
+
Convert.timestamp_to_time @grpc.end_time
|
171
|
+
end
|
172
|
+
|
173
|
+
##
|
174
|
+
# The size of the backup in bytes.
|
175
|
+
#
|
176
|
+
# @return [Integer]
|
177
|
+
#
|
178
|
+
def size_bytes
|
179
|
+
@grpc.size_bytes
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# The current state of the backup. Possible values are `:CREATING` and `:READY`.
|
184
|
+
#
|
185
|
+
# @return [Symbol]
|
186
|
+
#
|
187
|
+
def state
|
188
|
+
@grpc.state
|
189
|
+
end
|
190
|
+
|
191
|
+
##
|
192
|
+
# The backup is currently being created, and may be destroyed if the creation process encounters an error.
|
193
|
+
#
|
194
|
+
# @return [Boolean]
|
195
|
+
#
|
196
|
+
def creating?
|
197
|
+
state == :CREATING
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# The backup has been successfully created and is ready to serve requests.
|
202
|
+
#
|
203
|
+
# @return [Boolean]
|
204
|
+
#
|
205
|
+
def ready?
|
206
|
+
state == :READY
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# Creates a new table by restoring from a completed backup.
|
211
|
+
#
|
212
|
+
# @param table_id [String] The table ID for the new table. This table must not yet exist. Required.
|
213
|
+
#
|
214
|
+
# @return [Google::Cloud::Bigtable::Table::RestoreJob] The job representing the long-running, asynchronous
|
215
|
+
# processing of a backup restore table operation.
|
216
|
+
#
|
217
|
+
# @example
|
218
|
+
# require "google/cloud/bigtable"
|
219
|
+
#
|
220
|
+
# bigtable = Google::Cloud::Bigtable.new
|
221
|
+
# instance = bigtable.instance("my-instance")
|
222
|
+
# cluster = instance.cluster("my-cluster")
|
223
|
+
#
|
224
|
+
# backup = cluster.backup("my-backup")
|
225
|
+
#
|
226
|
+
# job = backup.restore("my-new-table")
|
227
|
+
#
|
228
|
+
# job.wait_until_done!
|
229
|
+
# job.done? #=> true
|
230
|
+
#
|
231
|
+
# if job.error?
|
232
|
+
# status = job.error
|
233
|
+
# else
|
234
|
+
# table = job.table
|
235
|
+
# optimized = job.optimize_table_operation_name
|
236
|
+
# end
|
237
|
+
#
|
238
|
+
def restore table_id
|
239
|
+
grpc = service.restore_table table_id, instance_id, cluster_id, backup_id
|
240
|
+
Table::RestoreJob.from_grpc grpc, service
|
241
|
+
end
|
242
|
+
|
243
|
+
##
|
244
|
+
# Updates the backup.
|
245
|
+
#
|
246
|
+
# `expire_time` is the only updatable field.
|
247
|
+
#
|
248
|
+
# @return [Boolean] Returns `true` if the update succeeded.
|
249
|
+
#
|
250
|
+
# @example
|
251
|
+
# require "google/cloud/bigtable"
|
252
|
+
#
|
253
|
+
# bigtable = Google::Cloud::Bigtable.new
|
254
|
+
# instance = bigtable.instance("my-instance")
|
255
|
+
# cluster = instance.cluster("my-cluster")
|
256
|
+
#
|
257
|
+
# backup = cluster.backup("my-backup")
|
258
|
+
#
|
259
|
+
# # Update
|
260
|
+
# backup.expire_time = Time.now + 60 * 60 * 7
|
261
|
+
# backup.save
|
262
|
+
#
|
263
|
+
def save
|
264
|
+
ensure_service!
|
265
|
+
@grpc = service.update_backup @grpc, [:expire_time]
|
266
|
+
true
|
267
|
+
end
|
268
|
+
alias update save
|
269
|
+
|
270
|
+
##
|
271
|
+
# Reloads backup data.
|
272
|
+
#
|
273
|
+
# @return [Google::Cloud::Bigtable::Backup]
|
274
|
+
#
|
275
|
+
def reload!
|
276
|
+
@grpc = service.get_backup instance_id, cluster_id, backup_id
|
277
|
+
self
|
278
|
+
end
|
279
|
+
|
280
|
+
##
|
281
|
+
# Permanently deletes the backup.
|
282
|
+
#
|
283
|
+
# @return [Boolean] Returns `true` if the backup was deleted.
|
284
|
+
#
|
285
|
+
# @example
|
286
|
+
# require "google/cloud/bigtable"
|
287
|
+
#
|
288
|
+
# bigtable = Google::Cloud::Bigtable.new
|
289
|
+
# instance = bigtable.instance("my-instance")
|
290
|
+
# cluster = instance.cluster("my-cluster")
|
291
|
+
#
|
292
|
+
# backup = cluster.backup("my-backup")
|
293
|
+
#
|
294
|
+
# backup.delete
|
295
|
+
#
|
296
|
+
def delete
|
297
|
+
ensure_service!
|
298
|
+
service.delete_backup instance_id, cluster_id, backup_id
|
299
|
+
true
|
300
|
+
end
|
301
|
+
|
302
|
+
# @private
|
303
|
+
#
|
304
|
+
# Creates a new Backup instance from a Google::Bigtable::Admin::V2::Backup.
|
305
|
+
#
|
306
|
+
# @param grpc [Google::Bigtable::Admin::V2::Backup]
|
307
|
+
# @param service [Google::Cloud::Bigtable::Service]
|
308
|
+
# @return [Google::Cloud::Bigtable::Backup]
|
309
|
+
def self.from_grpc grpc, service
|
310
|
+
new grpc, service
|
311
|
+
end
|
312
|
+
|
313
|
+
protected
|
314
|
+
|
315
|
+
# @private
|
316
|
+
#
|
317
|
+
# Raise an error unless an active connection to the service is available.
|
318
|
+
def ensure_service!
|
319
|
+
raise "Must have active connection to service" unless service
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|