org.apache.hadoop.hive.serde2.lazy
Class LazyNonPrimitive

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.lazy.LazyNonPrimitive
All Implemented Interfaces:
LazyObject
Direct Known Subclasses:
LazyArray, LazyMap, LazyStruct

public abstract class LazyNonPrimitive
extends Object
implements LazyObject

LazyPrimitive stores a primitive Object in a LazyObject.


Field Summary
protected  ByteArrayRef bytes
           
protected  int length
           
protected  int start
           
 
Constructor Summary
protected LazyNonPrimitive(TypeInfo typeInfo)
           
 
Method Summary
 Object getObject()
          If the LazyObject is a primitive Object, then deserialize it and return the actual primitive Object.
 void init(ByteArrayRef bytes, int start, int length)
          Set the data for this LazyObject.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bytes

protected ByteArrayRef bytes

start

protected int start

length

protected int length
Constructor Detail

LazyNonPrimitive

protected LazyNonPrimitive(TypeInfo typeInfo)
Method Detail

init

public void init(ByteArrayRef bytes,
                 int start,
                 int length)
Description copied from interface: LazyObject
Set the data for this LazyObject. We take ByteArrayRef instead of byte[] so that we will be able to drop the reference to byte[] by a single assignment. The ByteArrayRef object can be reused across multiple rows.

Specified by:
init in interface LazyObject
Parameters:
bytes - The wrapper of the byte[].
start - The start position inside the bytes.
length - The length of the data, starting from "start"
See Also:
ByteArrayRef

getObject

public Object getObject()
Description copied from interface: LazyObject
If the LazyObject is a primitive Object, then deserialize it and return the actual primitive Object. Otherwise (array, map, struct), return this.

Specified by:
getObject in interface LazyObject


Copyright © 2009 The Apache Software Foundation