class Google::Cloud::Bigtable::ColumnFamily

# ColumnFamily

A set of columns within a table that share a common configuration.

@example

require "google/cloud/bigtable"

bigtable = Google::Cloud::Bigtable.new

instance = bigtable.instance "my-instance"
table = instance.table "my-table"

column_family = table.column_families["cf2"]
puts column_family.gc_rule

Attributes

gc_rule[RW]

The garbage collection rule to be used for the column family. Optional. The service default value will be used when not specified.

@see cloud.google.com/bigtable/docs/garbage-collection Garbage collection

@return [Google::Cloud::Bigtable::GcRule, nil]

name[R]

Name of the column family. @return [String]

Public Class Methods

from_grpc(grpc, name) click to toggle source

@private

Create a new ColumnFamily instance from a {Google::Cloud::Bigtable::Admin::V2::ColumnFamily}.

@param grpc [Google::Cloud::Bigtable::Admin::V2::ColumnFamily] @param name [String] Column family name @return [Google::Cloud::Bigtable::ColumnFamily]

# File lib/google/cloud/bigtable/column_family.rb, line 69
def self.from_grpc grpc, name
  new(name).tap do |cf|
    cf.gc_rule = GcRule.from_grpc grpc.gc_rule if grpc.gc_rule
  end
end
new(name, gc_rule: nil) click to toggle source

@private

# File lib/google/cloud/bigtable/column_family.rb, line 56
def initialize name, gc_rule: nil
  @name = name
  @gc_rule = gc_rule
end