Class: MassiveRecord::Wrapper::ColumnFamily

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of ColumnFamily.



7
8
9
10
11
# File 'lib/massive_record/wrapper/column_family.rb', line 7

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.



5
6
7
# File 'lib/massive_record/wrapper/column_family.rb', line 5

def columns
  @columns
end

#max_versionsObject

Returns the value of attribute max_versions.



5
6
7
# File 'lib/massive_record/wrapper/column_family.rb', line 5

def max_versions
  @max_versions
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/massive_record/wrapper/column_family.rb', line 5

def name
  @name
end

Instance Method Details

#descriptorObject



13
14
15
16
17
18
# File 'lib/massive_record/wrapper/column_family.rb', line 13

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