com.datasalt.pangool.tuplemr.serialization
Class AvroFieldSerialization<T>

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

public class AvroFieldSerialization<T>
extends Object
implements org.apache.hadoop.io.serializer.Serialization<T>, Schema.Field.FieldConfigurable


Nested Class Summary
static class AvroFieldSerialization.AvroFieldDeserializer<T>
           
static class AvroFieldSerialization.AvroFieldSerializer<T>
           
 
Constructor Summary
AvroFieldSerialization()
           
 
Method Summary
 boolean accept(Class<?> c)
           
 org.apache.hadoop.io.serializer.Deserializer<T> getDeserializer(Class<T> clazz)
           
 org.apache.hadoop.io.serializer.Serializer<T> getSerializer(Class<T> clazz)
           
 void setFieldProperties(Map<String,String> readProperties, Map<String,String> targetProperties)
          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

AvroFieldSerialization

public AvroFieldSerialization()
Method Detail

getDeserializer

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

getSerializer

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

setFieldProperties

public void setFieldProperties(Map<String,String> readProperties,
                               Map<String,String> targetProperties)
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:
readProperties - Properties of this field, present when reading (deserializing).
targetProperties - 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<?> c)
Specified by:
accept in interface org.apache.hadoop.io.serializer.Serialization<T>


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