Class: HBase::Cell
- Inherits:
-
Object
- Object
- HBase::Cell
- Defined in:
- lib/hbase-jruby/cell.rb
Overview
@return [org.apache.hadoop.hbase.KeyValue]
Instance Attribute Summary collapse
-
#java ⇒ Object
readonly
Returns the value of attribute java.
Instance Method Summary collapse
-
#<=>(other) ⇒ Fixnum
Implements column key order.
-
#bigdecimal ⇒ BigDecimal
Returns the column value as a BigDecimal.
-
#boolean ⇒ true, false
(also: #bool)
Returns the column value as a boolean value.
-
#column_key ⇒ ColumnKey
Returns the ColumnKey object for the cell.
-
#family ⇒ String
(also: #cf)
Returns the name of the column family of the cell.
-
#fixnum ⇒ Fixnum
(also: #long)
Returns the column value as a Fixnum.
-
#float ⇒ Float
(also: #double)
Returns the column value as a Float.
-
#initialize(key_value) ⇒ Cell
constructor
Creates a boxed object for a KeyValue object.
-
#inspect ⇒ String
Returns a printable version of this cell.
-
#qualifier(type = :string) ⇒ Object
(also: #cq)
Returns the column qualifier of the cell.
-
#rowkey(type = :string) ⇒ String, byte[]
Returns the rowkey of the cell decoded as the given type.
-
#string ⇒ String
(also: #str)
Returns the column value as a String.
-
#symbol ⇒ Symbol
(also: #sym)
Returns the column value as a Symbol.
-
#timestamp ⇒ Fixnum
(also: #ts)
Returns the timestamp of the cell.
-
#value ⇒ byte[]
(also: #raw)
Returns the value of the cell as a Java byte array.
Constructor Details
#initialize(key_value) ⇒ Cell
Creates a boxed object for a KeyValue object
10 11 12 13 |
# File 'lib/hbase-jruby/cell.rb', line 10 def initialize key_value @java = key_value @ck = nil end |
Instance Attribute Details
#java ⇒ Object (readonly)
Returns the value of attribute java.
6 7 8 |
# File 'lib/hbase-jruby/cell.rb', line 6 def java @java end |
Instance Method Details
#<=>(other) ⇒ Fixnum
Implements column key order
103 104 105 |
# File 'lib/hbase-jruby/cell.rb', line 103 def <=> other KeyValue.COMPARATOR.compare(@java, other.java) end |
#bigdecimal ⇒ BigDecimal
Returns the column value as a BigDecimal
82 83 84 |
# File 'lib/hbase-jruby/cell.rb', line 82 def bigdecimal Util.from_bytes :bigdecimal, value end |
#boolean ⇒ true, false Also known as: bool
Returns the column value as a boolean value
95 96 97 |
# File 'lib/hbase-jruby/cell.rb', line 95 def boolean Util.from_bytes :boolean, value end |
#column_key ⇒ ColumnKey
Returns the ColumnKey object for the cell
25 26 27 |
# File 'lib/hbase-jruby/cell.rb', line 25 def column_key @ck ||= ColumnKey.new @java.getFamily, @java.getQualifier end |
#family ⇒ String Also known as: cf
Returns the name of the column family of the cell
31 32 33 |
# File 'lib/hbase-jruby/cell.rb', line 31 def family String.from_java_bytes @java.getFamily end |
#fixnum ⇒ Fixnum Also known as: long
Returns the column value as a Fixnum
75 76 77 |
# File 'lib/hbase-jruby/cell.rb', line 75 def fixnum Util.from_bytes :fixnum, value end |
#float ⇒ Float Also known as: double
Returns the column value as a Float
88 89 90 |
# File 'lib/hbase-jruby/cell.rb', line 88 def float Util.from_bytes :float, value end |
#inspect ⇒ String
Returns a printable version of this cell
109 110 111 |
# File 'lib/hbase-jruby/cell.rb', line 109 def inspect %[#{cf}:#{cq} = "#{string}"@#{ts}] end |
#qualifier(type = :string) ⇒ Object Also known as: cq
Returns the column qualifier of the cell
40 41 42 |
# File 'lib/hbase-jruby/cell.rb', line 40 def qualifier type = :string Util.from_bytes type, @java.getQualifier end |
#rowkey(type = :string) ⇒ String, byte[]
Returns the rowkey of the cell decoded as the given type
19 20 21 |
# File 'lib/hbase-jruby/cell.rb', line 19 def rowkey type = :string Util.from_bytes type, @java.getRow end |
#string ⇒ String Also known as: str
Returns the column value as a String
61 62 63 |
# File 'lib/hbase-jruby/cell.rb', line 61 def string Util.from_bytes :string, value end |
#symbol ⇒ Symbol Also known as: sym
Returns the column value as a Symbol
68 69 70 |
# File 'lib/hbase-jruby/cell.rb', line 68 def symbol Util.from_bytes :symbol, value end |
#timestamp ⇒ Fixnum Also known as: ts
Returns the timestamp of the cell
47 48 49 |
# File 'lib/hbase-jruby/cell.rb', line 47 def @java.getTimestamp end |
#value ⇒ byte[] Also known as: raw
Returns the value of the cell as a Java byte array
54 55 56 |
# File 'lib/hbase-jruby/cell.rb', line 54 def value @java.getValue end |