com.datasalt.pangool.tuplemr.serialization
Class SimpleTupleSerializer

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

public class SimpleTupleSerializer
extends Object
implements org.apache.hadoop.io.serializer.Serializer<ITuple>

This Serializer holds all the baseline code for serializing Tuples. It is used by the more complex TupleSerializer. It is also used by a stateful Tuple field serializer TupleFieldSerialization.


Nested Class Summary
static class SimpleTupleSerializer.CustomObjectSerializationException
          Thrown when an unexpected exception happens when serializing a custom object.
 
Constructor Summary
SimpleTupleSerializer(HadoopSerialization ser)
           
SimpleTupleSerializer(Schema schemaToSerialize, HadoopSerialization ser, org.apache.hadoop.conf.Configuration conf)
           
 
Method Summary
 void close()
           
 DataOutputStream getOut()
           
 void open(OutputStream outputStream)
           
 void serialize(ITuple tuple)
           
protected  Object valueAt(int idx, ITuple tuple, int[] translationTable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleTupleSerializer

public SimpleTupleSerializer(HadoopSerialization ser)

SimpleTupleSerializer

public SimpleTupleSerializer(Schema schemaToSerialize,
                             HadoopSerialization ser,
                             org.apache.hadoop.conf.Configuration conf)
Method Detail

close

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

open

public void open(OutputStream outputStream)
Specified by:
open in interface org.apache.hadoop.io.serializer.Serializer<ITuple>

serialize

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

getOut

public DataOutputStream getOut()

valueAt

protected Object valueAt(int idx,
                         ITuple tuple,
                         int[] translationTable)
Returns:
A value in the tuple represented by the idx. If a translationTable is given, then idx is translated before being applied to obtain the value from the tuple.


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