org.apache.hadoop.hive.serde2.lazy
Interface LazyObject

All Known Implementing Classes:
LazyArray, LazyByte, LazyDouble, LazyInteger, LazyLong, LazyMap, LazyNonPrimitive, LazyPrimitive, LazyShort, LazyString, LazyStruct

public interface LazyObject

LazyObject stores an object in a range of bytes in a byte[]. A LazyObject can represent any primitive object or hierarchical object like array, map or struct.


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.
 

Method Detail

init

void init(ByteArrayRef bytes,
          int start,
          int length)
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.

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

Object getObject()
If the LazyObject is a primitive Object, then deserialize it and return the actual primitive Object. Otherwise (array, map, struct), return this.



Copyright © 2009 The Apache Software Foundation