org.apache.hadoop.hive.serde2.objectinspector.primitive
Class WritableBinaryObjectInspector

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.objectinspector.primitive.AbstractPrimitiveObjectInspector
      extended by org.apache.hadoop.hive.serde2.objectinspector.primitive.AbstractPrimitiveWritableObjectInspector
          extended by org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableBinaryObjectInspector
All Implemented Interfaces:
Cloneable, ObjectInspector, BinaryObjectInspector, SettableBinaryObjectInspector, PrimitiveObjectInspector, PrimitiveTypeSpec
Direct Known Subclasses:
WritableConstantBinaryObjectInspector

public class WritableBinaryObjectInspector
extends AbstractPrimitiveWritableObjectInspector
implements SettableBinaryObjectInspector

A WritableBinaryObjectInspector inspects a BytesWritable Object.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector
PrimitiveObjectInspector.PrimitiveCategory
 
Nested classes/interfaces inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
ObjectInspector.Category
 
Field Summary
 
Fields inherited from class org.apache.hadoop.hive.serde2.objectinspector.primitive.AbstractPrimitiveObjectInspector
typeParams
 
Method Summary
 BytesWritable copyObject(Object o)
          Get a copy of the Object in the same class, so the return value can be stored independently of the parameter.
 BytesWritable create(byte[] bb)
          Create an object with the value.
 BytesWritable create(BytesWritable bw)
          Create an object with the value.
 byte[] getPrimitiveJavaObject(Object o)
          Get the Java Primitive object.
 BytesWritable getPrimitiveWritableObject(Object o)
          Return the data in an instance of primitive writable Object.
 BytesWritable set(Object o, byte[] bb)
          Set the object with the value.
 BytesWritable set(Object o, BytesWritable bw)
          Set the object with the value.
 
Methods inherited from class org.apache.hadoop.hive.serde2.objectinspector.primitive.AbstractPrimitiveWritableObjectInspector
preferWritable
 
Methods inherited from class org.apache.hadoop.hive.serde2.objectinspector.primitive.AbstractPrimitiveObjectInspector
getCategory, getJavaPrimitiveClass, getPrimitiveCategory, getPrimitiveWritableClass, getTypeName, getTypeParams, setTypeParams
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.hadoop.hive.serde2.objectinspector.PrimitiveObjectInspector
getJavaPrimitiveClass, getPrimitiveCategory, getPrimitiveWritableClass, getTypeParams, preferWritable, setTypeParams
 
Methods inherited from interface org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector
getCategory, getTypeName
 

Method Detail

copyObject

public BytesWritable copyObject(Object o)
Description copied from interface: PrimitiveObjectInspector
Get a copy of the Object in the same class, so the return value can be stored independently of the parameter. If the Object is a Primitive Java Object, we just return the parameter since Primitive Java Object is immutable.

Specified by:
copyObject in interface PrimitiveObjectInspector

getPrimitiveJavaObject

public byte[] getPrimitiveJavaObject(Object o)
Description copied from interface: PrimitiveObjectInspector
Get the Java Primitive object.

Specified by:
getPrimitiveJavaObject in interface BinaryObjectInspector
Specified by:
getPrimitiveJavaObject in interface PrimitiveObjectInspector

getPrimitiveWritableObject

public BytesWritable getPrimitiveWritableObject(Object o)
Description copied from interface: PrimitiveObjectInspector
Return the data in an instance of primitive writable Object. If the Object is already a primitive writable Object, just return o.

Specified by:
getPrimitiveWritableObject in interface BinaryObjectInspector
Specified by:
getPrimitiveWritableObject in interface PrimitiveObjectInspector
Overrides:
getPrimitiveWritableObject in class AbstractPrimitiveWritableObjectInspector

set

public BytesWritable set(Object o,
                         byte[] bb)
Description copied from interface: SettableBinaryObjectInspector
Set the object with the value. Return the object that has the new value. In most cases the returned value should be the same as o, but in case o is unmodifiable, this will return a new object with new value.

Specified by:
set in interface SettableBinaryObjectInspector

set

public BytesWritable set(Object o,
                         BytesWritable bw)
Description copied from interface: SettableBinaryObjectInspector
Set the object with the value. Return the object that has the new value. In most cases the returned value should be the same as o, but in case o is unmodifiable, this will return a new object with new value.

Specified by:
set in interface SettableBinaryObjectInspector

create

public BytesWritable create(byte[] bb)
Description copied from interface: SettableBinaryObjectInspector
Create an object with the value.

Specified by:
create in interface SettableBinaryObjectInspector

create

public BytesWritable create(BytesWritable bw)
Description copied from interface: SettableBinaryObjectInspector
Create an object with the value.

Specified by:
create in interface SettableBinaryObjectInspector


Copyright © 2012 The Apache Software Foundation