org.apache.hadoop.hive.hbase
Class HBaseCompositeKey

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.HBaseCompositeKey
All Implemented Interfaces:
SerDeStatsStruct

public class HBaseCompositeKey
extends LazyStruct

HBaseCompositeKey extension of LazyStruct. All complex composite keys should extend this class and override the LazyStruct.getField(int) method where fieldID corresponds to the ID of a key in the composite key.

For example, for a composite key "/part1/part2/part3", part1 will have an id 0, part2 will have an id 1 and part3 will have an id 2. Custom implementations of getField(fieldID) should return the value corresponding to that fieldID. So, for the above example, the value returned for getField(0) should be part1, getField(1) should be part2 and getField(2) should be part3.

All custom implementation are expected to have a constructor of the form:

 MyCustomCompositeKey(LazySimpleStructObjectInspector oi, Properties tbl, Configuration conf)
 


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
HBaseCompositeKey(LazySimpleStructObjectInspector oi)
           
 
Method Summary
 ArrayList<Object> getFieldsAsList()
           
 LazyObject<? extends ObjectInspector> toLazyObject(int fieldID, byte[] bytes)
          Create an initialize a LazyObject with the given bytes for the given fieldID.
 
Methods inherited from class org.apache.hadoop.hive.serde2.lazy.LazyStruct
getField, getFieldInited, getFields, getObject, 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

HBaseCompositeKey

public HBaseCompositeKey(LazySimpleStructObjectInspector oi)
Method Detail

getFieldsAsList

public ArrayList<Object> getFieldsAsList()
Overrides:
getFieldsAsList in class LazyStruct

toLazyObject

public LazyObject<? extends ObjectInspector> toLazyObject(int fieldID,
                                                          byte[] bytes)
Create an initialize a LazyObject with the given bytes for the given fieldID.

Parameters:
fieldID - field for which the object is to be created
bytes - value with which the object is to be initialized with
Returns:
initialized LazyObject


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