org.apache.hadoop.hive.serde2
Class AbstractSerializer

java.lang.Object
  extended by org.apache.hadoop.hive.serde2.AbstractSerializer
All Implemented Interfaces:
Serializer

public abstract class AbstractSerializer
extends Object
implements Serializer

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


Constructor Summary
AbstractSerializer()
           
 
Method Summary
abstract  SerDeStats getSerDeStats()
          Returns statistics collected when serializing
abstract  Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
          Returns the Writable class that would be returned by the serialize method.
abstract  void initialize(org.apache.hadoop.conf.Configuration conf, Properties tbl)
          Initialize the HiveSerializer.
abstract  org.apache.hadoop.io.Writable serialize(Object obj, ObjectInspector objInspector)
          Serialize an object by navigating inside the Object with the ObjectInspector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSerializer

public AbstractSerializer()
Method Detail

initialize

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

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

getSerializedClass

public abstract Class<? extends org.apache.hadoop.io.Writable> getSerializedClass()
Returns the Writable class that would be returned by the serialize method. This is used to initialize SequenceFile header.

Specified by:
getSerializedClass in interface Serializer

serialize

public abstract org.apache.hadoop.io.Writable serialize(Object obj,
                                                        ObjectInspector objInspector)
                                                 throws SerDeException
Serialize an object by navigating inside the Object with the ObjectInspector. In most cases, the return value of this function will be constant since the function will reuse the Writable object. If the client wants to keep a copy of the Writable, the client needs to clone the returned value.

Specified by:
serialize in interface Serializer
Throws:
SerDeException

getSerDeStats

public abstract SerDeStats getSerDeStats()
Returns statistics collected when serializing

Specified by:
getSerDeStats in interface Serializer


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