T
- The Java type of the Avro data to serialize.public class AvroSerialization<T> extends org.apache.hadoop.conf.Configured implements org.apache.hadoop.io.serializer.Serialization<AvroWrapper<T>>
Serialization
used by jobs configured with
AvroJob
.Constructor and Description |
---|
AvroSerialization() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Class<?> c) |
static void |
addToConfiguration(org.apache.hadoop.conf.Configuration conf)
Adds the AvroSerialization scheme to the configuration, so SerializationFactory
instances constructed from the given configuration will be aware of it.
|
org.apache.hadoop.io.serializer.Deserializer<AvroWrapper<T>> |
getDeserializer(Class<AvroWrapper<T>> c)
Gets an object capable of deserializing the output from a Mapper.
|
static Schema |
getKeyReaderSchema(org.apache.hadoop.conf.Configuration conf)
Gets the reader schema of the AvroKey datum that is being serialized/deserialized.
|
static Schema |
getKeyWriterSchema(org.apache.hadoop.conf.Configuration conf)
Gets the writer schema of the AvroKey datum that is being serialized/deserialized.
|
org.apache.hadoop.io.serializer.Serializer<AvroWrapper<T>> |
getSerializer(Class<AvroWrapper<T>> c)
Gets an object capable of serializing output from a Mapper.
|
static Schema |
getValueReaderSchema(org.apache.hadoop.conf.Configuration conf)
Gets the reader schema of the AvroValue datum that is being serialized/deserialized.
|
static Schema |
getValueWriterSchema(org.apache.hadoop.conf.Configuration conf)
Gets the writer schema of the AvroValue datum that is being serialized/deserialized.
|
static void |
setKeyReaderSchema(org.apache.hadoop.conf.Configuration conf,
Schema schema)
Sets the reader schema of the AvroKey datum that is being serialized/deserialized.
|
static void |
setKeyWriterSchema(org.apache.hadoop.conf.Configuration conf,
Schema schema)
Sets the writer schema of the AvroKey datum that is being serialized/deserialized.
|
static void |
setValueReaderSchema(org.apache.hadoop.conf.Configuration conf,
Schema schema)
Sets the reader schema of the AvroValue datum that is being serialized/deserialized.
|
static void |
setValueWriterSchema(org.apache.hadoop.conf.Configuration conf,
Schema schema)
Sets the writer schema of the AvroValue datum that is being serialized/deserialized.
|
public boolean accept(Class<?> c)
accept
in interface org.apache.hadoop.io.serializer.Serialization<AvroWrapper<T>>
public org.apache.hadoop.io.serializer.Deserializer<AvroWrapper<T>> getDeserializer(Class<AvroWrapper<T>> c)
getDeserializer
in interface org.apache.hadoop.io.serializer.Serialization<AvroWrapper<T>>
c
- The class to get a deserializer for.c
.public org.apache.hadoop.io.serializer.Serializer<AvroWrapper<T>> getSerializer(Class<AvroWrapper<T>> c)
getSerializer
in interface org.apache.hadoop.io.serializer.Serialization<AvroWrapper<T>>
c
- The class to get a serializer for.c
.public static void addToConfiguration(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration to add AvroSerialization to.public static void setKeyWriterSchema(org.apache.hadoop.conf.Configuration conf, Schema schema)
conf
- The configuration.schema
- The Avro key schema.public static void setKeyReaderSchema(org.apache.hadoop.conf.Configuration conf, Schema schema)
conf
- The configuration.schema
- The Avro key schema.public static void setValueWriterSchema(org.apache.hadoop.conf.Configuration conf, Schema schema)
conf
- The configuration.schema
- The Avro value schema.public static void setValueReaderSchema(org.apache.hadoop.conf.Configuration conf, Schema schema)
conf
- The configuration.schema
- The Avro value schema.public static Schema getKeyWriterSchema(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration.public static Schema getKeyReaderSchema(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration.public static Schema getValueWriterSchema(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration.public static Schema getValueReaderSchema(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration.Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.