com.datasalt.pangool.tuplemr.serialization
Class SimpleTupleDeserializer

java.lang.Object
  extended by com.datasalt.pangool.tuplemr.serialization.SimpleTupleDeserializer
All Implemented Interfaces:
org.apache.hadoop.io.serializer.Deserializer<ITuple>

public class SimpleTupleDeserializer
extends Object
implements org.apache.hadoop.io.serializer.Deserializer<ITuple>

This Deserializer holds all the baseline code for deserializing Tuples. It is used by the more complex TupleDeserializer. It is also used by a stateful Tuple field serializer TupleFieldSerialization and finally it is also used by the stateful TupleFile.


Constructor Summary
SimpleTupleDeserializer(Schema schemaToDeserialize, HadoopSerialization ser, org.apache.hadoop.conf.Configuration conf)
          Constructor with one Schema.
SimpleTupleDeserializer(Schema readSchema, Schema targetSchema, HadoopSerialization ser, org.apache.hadoop.conf.Configuration conf)
          Constructor with two schemas.
 
Method Summary
 void close()
           
 ITuple deserialize(ITuple tuple)
           
 DataInputStream getInput()
           
 void open(InputStream input)
           
 void readBytes(DataInputStream input, ITuple tuple, int index)
           
protected  void readCustomObject(DataInputStream input, ITuple tuple, Class<?> expectedType, int index, org.apache.hadoop.io.serializer.Deserializer customDeser)
           
protected  void readEnum(DataInputStream input, ITuple tuple, Class<?> fieldType, int index)
           
 void readFields(ITuple tuple, org.apache.hadoop.io.serializer.Deserializer[] customDeserializers)
          Read fields using the specified "readSchema" in the constructor.
protected  void readUtf8(DataInputStream input, ITuple tuple, int index)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTupleDeserializer

public SimpleTupleDeserializer(Schema schemaToDeserialize,
                               HadoopSerialization ser,
                               org.apache.hadoop.conf.Configuration conf)
Constructor with one Schema. This Schema will be used to read Tuples.


SimpleTupleDeserializer

public SimpleTupleDeserializer(Schema readSchema,
                               Schema targetSchema,
                               HadoopSerialization ser,
                               org.apache.hadoop.conf.Configuration conf)
Constructor with two schemas. In this case we deserialize one Schema but we write the final result into another one (which should be backwards compatible).

Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface org.apache.hadoop.io.serializer.Deserializer<ITuple>
Throws:
IOException

deserialize

public ITuple deserialize(ITuple tuple)
                   throws IOException
Specified by:
deserialize in interface org.apache.hadoop.io.serializer.Deserializer<ITuple>
Throws:
IOException

open

public void open(InputStream input)
          throws IOException
Specified by:
open in interface org.apache.hadoop.io.serializer.Deserializer<ITuple>
Throws:
IOException

readFields

public void readFields(ITuple tuple,
                       org.apache.hadoop.io.serializer.Deserializer[] customDeserializers)
                throws IOException
Read fields using the specified "readSchema" in the constructor.

Throws:
IOException

readUtf8

protected void readUtf8(DataInputStream input,
                        ITuple tuple,
                        int index)
                 throws IOException
Throws:
IOException

readCustomObject

protected void readCustomObject(DataInputStream input,
                                ITuple tuple,
                                Class<?> expectedType,
                                int index,
                                org.apache.hadoop.io.serializer.Deserializer customDeser)
                         throws IOException
Throws:
IOException

readBytes

public void readBytes(DataInputStream input,
                      ITuple tuple,
                      int index)
               throws IOException
Throws:
IOException

getInput

public DataInputStream getInput()

readEnum

protected void readEnum(DataInputStream input,
                        ITuple tuple,
                        Class<?> fieldType,
                        int index)
                 throws IOException
Throws:
IOException


Copyright © –2014 Datasalt Systems S.L.. All rights reserved.