Class: MassiveRecord::Adapters::Thrift::ColumnFamily
- Inherits:
-
Object
- Object
- MassiveRecord::Adapters::Thrift::ColumnFamily
- Defined in:
- lib/massive_record/adapters/thrift/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.
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
#columns ⇒ Object
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_versions ⇒ Object
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 |
#name ⇒ Object
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
#descriptor ⇒ Object
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 |