org.apache.hadoop.hive.serde2
Class AbstractDeserializer

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.AbstractDeserializer
All Implemented Interfaces:
Deserializer
Direct Known Subclasses:
ThriftDeserializer

public abstract class AbstractDeserializer
extends Object
implements Deserializer

Abstract class for implementing Deserializer. The abstract class has been created, so that new methods can be added in the underlying interface, Deserializer, and only implementations that need those methods overwrite it.


Constructor Summary
AbstractDeserializer()
           
 
Method Summary
abstract  Object deserialize(org.apache.hadoop.io.Writable blob)
          Deserialize an object out of a Writable blob.
abstract  ObjectInspector getObjectInspector()
          Get the object inspector that can be used to navigate through the internal structure of the Object returned from deserialize(...).
abstract  SerDeStats getSerDeStats()
          Returns statistics collected when serializing
abstract  void initialize(org.apache.hadoop.conf.Configuration conf, Properties tbl)
          Initialize the HiveDeserializer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDeserializer

public AbstractDeserializer()
Method Detail

initialize

public abstract void initialize(org.apache.hadoop.conf.Configuration conf,
                                Properties tbl)
                         throws SerDeException
Initialize the HiveDeserializer.

Specified by:
initialize in interface Deserializer
Parameters:
conf - System properties
tbl - table properties
Throws:
SerDeException

deserialize

public abstract Object deserialize(org.apache.hadoop.io.Writable blob)
                            throws SerDeException
Deserialize an object out of a Writable blob. In most cases, the return value of this function will be constant since the function will reuse the returned object. If the client wants to keep a copy of the object, the client needs to clone the returned value by calling ObjectInspectorUtils.getStandardObject().

Specified by:
deserialize in interface Deserializer
Parameters:
blob - The Writable object containing a serialized object
Returns:
A Java object representing the contents in the blob.
Throws:
SerDeException

getObjectInspector

public abstract ObjectInspector getObjectInspector()
                                            throws SerDeException
Get the object inspector that can be used to navigate through the internal structure of the Object returned from deserialize(...).

Specified by:
getObjectInspector in interface Deserializer
Throws:
SerDeException

getSerDeStats

public abstract SerDeStats getSerDeStats()
Returns statistics collected when serializing

Specified by:
getSerDeStats in interface Deserializer


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