Class: MassiveRecord::Wrapper::ColumnFamily
- Inherits:
-
Object
- Object
- MassiveRecord::Wrapper::ColumnFamily
- Defined in:
- lib/massive_record/wrapper/column_family.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
Returns the value of attribute columns.
-
#max_versions ⇒ Object
Returns the value of attribute max_versions.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #descriptor ⇒ Object
-
#initialize(column_name, opts = {}) ⇒ ColumnFamily
constructor
A new instance of ColumnFamily.
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
#columns ⇒ Object
Returns the value of attribute columns.
5 6 7 |
# File 'lib/massive_record/wrapper/column_family.rb', line 5 def columns @columns end |
#max_versions ⇒ Object
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 |
#name ⇒ Object
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
#descriptor ⇒ Object
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 |