org.apache.hadoop.hive.hbase
Class LazyHBaseRow

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.lazy.LazyObjectBase
      extended by org.apache.hadoop.hive.serde2.lazy.LazyObject<OI>
          extended by org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive<LazySimpleStructObjectInspector>
              extended by org.apache.hadoop.hive.serde2.lazy.LazyStruct
                  extended by org.apache.hadoop.hive.hbase.LazyHBaseRow
All Implemented Interfaces:
SerDeStatsStruct

public class LazyHBaseRow
extends LazyStruct

LazyObject for storing an HBase row. The field of an HBase row can be primitive or non-primitive.


Field Summary
 
Fields inherited from class org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive
bytes, length, start
 
Fields inherited from class org.apache.hadoop.hive.serde2.lazy.LazyObject
oi
 
Constructor Summary
LazyHBaseRow(LazySimpleStructObjectInspector oi)
          Construct a LazyHBaseRow object with the ObjectInspector.
 
Method Summary
 Object getField(int fieldID)
          Get one field out of the HBase row.
 ArrayList<Object> getFieldsAsList()
          Get the values of the fields as an ArrayList.
 Object getObject()
           
 void init(org.apache.hadoop.hbase.client.Result r, List<org.apache.hadoop.hive.hbase.HBaseSerDe.ColumnMapping> columnsMapping)
          Set the HBase row data(a Result writable) for this LazyStruct.
 void init(org.apache.hadoop.hbase.client.Result r, List<org.apache.hadoop.hive.hbase.HBaseSerDe.ColumnMapping> columnsMapping, Object compositeKeyObj)
          Set the HBase row data(a Result writable) for this LazyStruct.
 
Methods inherited from class org.apache.hadoop.hive.serde2.lazy.LazyStruct
getFieldInited, getFields, getParsed, getRawDataSerializedSize, init, setFieldInited, setFields, setParsed
 
Methods inherited from class org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive
hashCode
 
Methods inherited from class org.apache.hadoop.hive.serde2.lazy.LazyObject
getInspector, setInspector
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyHBaseRow

public LazyHBaseRow(LazySimpleStructObjectInspector oi)
Construct a LazyHBaseRow object with the ObjectInspector.

Method Detail

init

public void init(org.apache.hadoop.hbase.client.Result r,
                 List<org.apache.hadoop.hive.hbase.HBaseSerDe.ColumnMapping> columnsMapping)
Set the HBase row data(a Result writable) for this LazyStruct.

See Also:
LazyHBaseRow#init(Result)

init

public void init(org.apache.hadoop.hbase.client.Result r,
                 List<org.apache.hadoop.hive.hbase.HBaseSerDe.ColumnMapping> columnsMapping,
                 Object compositeKeyObj)
Set the HBase row data(a Result writable) for this LazyStruct.

Parameters:
compositeKeyClass - custom implementation to interpret the composite key
See Also:
LazyHBaseRow#init(Result)

getField

public Object getField(int fieldID)
Get one field out of the HBase row. If the field is a primitive field, return the actual object. Otherwise return the LazyObject. This is because PrimitiveObjectInspector does not have control over the object used by the user - the user simply directly uses the Object instead of going through Object PrimitiveObjectInspector.get(Object).

Overrides:
getField in class LazyStruct
Parameters:
fieldID - The field ID
Returns:
The field as a LazyObject

getFieldsAsList

public ArrayList<Object> getFieldsAsList()
Get the values of the fields as an ArrayList.

Overrides:
getFieldsAsList in class LazyStruct
Returns:
The values of the fields as an ArrayList.

getObject

public Object getObject()
Overrides:
getObject in class LazyStruct


Copyright © 2014 The Apache Software Foundation. All rights reserved.