com.datasalt.pangool.tuplemr.serialization
Class TupleFieldSerialization

java.lang.Object
  extended by com.datasalt.pangool.tuplemr.serialization.TupleFieldSerialization
All Implemented Interfaces:
Schema.Field.FieldConfigurable, org.apache.hadoop.conf.Configurable, org.apache.hadoop.io.serializer.Serialization<ITuple>

public class TupleFieldSerialization
extends Object
implements org.apache.hadoop.io.serializer.Serialization<ITuple>, Schema.Field.FieldConfigurable, org.apache.hadoop.conf.Configurable

Serializes a Tuple withing a Pangool field. Allows for tuples inside tuples.


Constructor Summary
TupleFieldSerialization()
           
 
Method Summary
 boolean accept(Class<?> argClazz)
           
 org.apache.hadoop.conf.Configuration getConf()
           
 org.apache.hadoop.io.serializer.Deserializer<ITuple> getDeserializer(Class<ITuple> argClazz)
           
 org.apache.hadoop.io.serializer.Serializer<ITuple> getSerializer(Class<ITuple> argClazz)
           
 void setConf(org.apache.hadoop.conf.Configuration conf)
           
 void setFieldProperties(Map<String,String> readProps, Map<String,String> targetProps)
          Sets the properties for this field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleFieldSerialization

public TupleFieldSerialization()
Method Detail

setFieldProperties

public void setFieldProperties(Map<String,String> readProps,
                               Map<String,String> targetProps)
Description copied from interface: Schema.Field.FieldConfigurable
Sets the properties for this field.

Properties may come from configuration for serializing or may have been read from a data source when deserializing. As Fields may implement custom Serializers / Deserializers, backwards compatibility might be preserved by each implementation. For that, we provide both properties read from deserializing and properties specified by the user as "target" for this Field. Below we specify the exact meaning of each parameter:

Specified by:
setFieldProperties in interface Schema.Field.FieldConfigurable
Parameters:
readProps - Properties of this field, present when reading (deserializing).
targetProps - Properties of this field, specified for serializing. If readProps is also present, targetProps are to be taken as an updated configuration for this field. In this way backwards compatibility can be managed by each Serializer / Deserializer.

accept

public boolean accept(Class<?> argClazz)
Specified by:
accept in interface org.apache.hadoop.io.serializer.Serialization<ITuple>

getDeserializer

public org.apache.hadoop.io.serializer.Deserializer<ITuple> getDeserializer(Class<ITuple> argClazz)
Specified by:
getDeserializer in interface org.apache.hadoop.io.serializer.Serialization<ITuple>

getSerializer

public org.apache.hadoop.io.serializer.Serializer<ITuple> getSerializer(Class<ITuple> argClazz)
Specified by:
getSerializer in interface org.apache.hadoop.io.serializer.Serialization<ITuple>

getConf

public org.apache.hadoop.conf.Configuration getConf()
Specified by:
getConf in interface org.apache.hadoop.conf.Configurable

setConf

public void setConf(org.apache.hadoop.conf.Configuration conf)
Specified by:
setConf in interface org.apache.hadoop.conf.Configurable


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