Class: MassiveRecord::Adapters::Thrift::ColumnFamily

Inherits:
Object
  • Object
show all
Defined in:
lib/massive_record/adapters/thrift/column_family.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column_name, opts = {}) ⇒ ColumnFamily

Returns a new instance of ColumnFamily.



8
9
10
11
12
# File 'lib/massive_record/adapters/thrift/column_family.rb', line 8

def initialize(column_name, opts = {})
  @name = column_name
  @max_versions = opts[:max_versions] || 10
  @columns = opts[:columns] || []
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



6
7
8
# File 'lib/massive_record/adapters/thrift/column_family.rb', line 6

def columns
  @columns
end

#max_versionsObject

Returns the value of attribute max_versions.



6
7
8
# File 'lib/massive_record/adapters/thrift/column_family.rb', line 6

def max_versions
  @max_versions
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/massive_record/adapters/thrift/column_family.rb', line 6

def name
  @name
end

Instance Method Details

#descriptorObject



14
15
16
17
18
19
# File 'lib/massive_record/adapters/thrift/column_family.rb', line 14

def descriptor
  Apache::Hadoop::Hbase::Thrift::ColumnDescriptor.new do |col|
    col.name = "#{name}:"
    col.maxVersions = max_versions
  end
end