Class: Google::Cloud::Bigtable::ColumnFamily
- Inherits:
-
Object
- Object
- Google::Cloud::Bigtable::ColumnFamily
- Defined in:
- lib/google/cloud/bigtable/column_family.rb
Overview
ColumnFamily
A set of columns within a table which share a common configuration.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Column family name.
Class Method Summary collapse
-
.create_modification(name, gc_rule) ⇒ Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification
Create gPRC instance to create column family modification.
-
.drop_modification(name) ⇒ Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification
Create drop column family modification gRPC instance.
-
.update_modification(name, gc_rule) ⇒ Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification
Create update column family modification gPRC instance.
Instance Method Summary collapse
-
#create ⇒ Google::Cloud::Bigtable::ColumnFamily
Create column family.
-
#delete ⇒ Google::Cloud::Bigtable::Table
Permanently delete column family from table.
-
#gc_rule ⇒ Google::Cloud::Bigtable::GcRule
Get GC rule.
-
#gc_rule=(rule) ⇒ Object
Set GC rule.
-
#save ⇒ Google::Cloud::Bigtable::ColumnFamily
(also: #update)
Update column family.
Instance Attribute Details
#name ⇒ Object (readonly)
Column family name
60 61 62 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 60 def name @name end |
Class Method Details
.create_modification(name, gc_rule) ⇒ Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification
Create gPRC instance to create column family modification
164 165 166 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 164 def self.create_modification name, gc_rule column_modification_grpc(:create, name, gc_rule) end |
.drop_modification(name) ⇒ Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification
Create drop column family modification gRPC instance
195 196 197 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 195 def self.drop_modification name column_modification_grpc(:drop, name) end |
.update_modification(name, gc_rule) ⇒ Google::Bigtable::Admin::V2::ModifyColumnFamiliesRequest::Modification
Create update column family modification gPRC instance
181 182 183 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 181 def self.update_modification name, gc_rule column_modification_grpc(:update, name, gc_rule) end |
Instance Method Details
#create ⇒ Google::Cloud::Bigtable::ColumnFamily
Create column family.
107 108 109 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 107 def create modify_column_family(self.class.create_modification(name, gc_rule)) end |
#delete ⇒ Google::Cloud::Bigtable::Table
Permanently delete column family from table.
147 148 149 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 147 def delete modify_column_family(self.class.drop_modification(name)).nil? end |
#gc_rule ⇒ Google::Cloud::Bigtable::GcRule
Get GC rule
87 88 89 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 87 def gc_rule GcRule.from_grpc(@grpc.gc_rule) if @grpc.gc_rule end |
#gc_rule=(rule) ⇒ Object
Set GC rule
79 80 81 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 79 def gc_rule= rule @grpc.gc_rule = rule.to_grpc end |
#save ⇒ Google::Cloud::Bigtable::ColumnFamily Also known as: update
Update column family.
127 128 129 |
# File 'lib/google/cloud/bigtable/column_family.rb', line 127 def save modify_column_family(self.class.update_modification(name, gc_rule)) end |