|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avro.hadoop.io.AvroDeserializer<T,D>
T - The type of Avro wrapper.D - The Java type of the Avro data being wrapped.public abstract class AvroDeserializer<T extends AvroWrapper<D>,D>
Deserializes AvroWrapper objects within Hadoop.
Keys and values containing Avro tyeps are more efficiently serialized
outside of the WritableSerialization model, so they are wrapper in AvroWrapper objects and deserialization is handled
by this class.
MapReduce jobs that use AvroWrapper objects as keys or values need to be
configured with org.apache.avro.io.AvroSerialization. Use AvroJob to help with Job configuration.
| Constructor Summary | |
|---|---|
protected |
AvroDeserializer(org.apache.avro.Schema writerSchema,
org.apache.avro.Schema readerSchema,
ClassLoader classLoader)
Constructor. |
| Method Summary | |
|---|---|
void |
close()
|
protected abstract T |
createAvroWrapper()
Creates a new empty T (extends AvroWrapper) instance. |
T |
deserialize(T avroWrapperToReuse)
|
org.apache.avro.Schema |
getReaderSchema()
Gets the reader schema used for deserializing. |
org.apache.avro.Schema |
getWriterSchema()
Gets the writer schema used for deserializing. |
void |
open(InputStream inputStream)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AvroDeserializer(org.apache.avro.Schema writerSchema,
org.apache.avro.Schema readerSchema,
ClassLoader classLoader)
writerSchema - The Avro writer schema for the data to deserialize.readerSchema - The Avro reader schema for the data to deserialize (may be null).| Method Detail |
|---|
public org.apache.avro.Schema getWriterSchema()
public org.apache.avro.Schema getReaderSchema()
public void open(InputStream inputStream)
throws IOException
open in interface org.apache.hadoop.io.serializer.Deserializer<T extends AvroWrapper<D>>IOException
public T deserialize(T avroWrapperToReuse)
throws IOException
deserialize in interface org.apache.hadoop.io.serializer.Deserializer<T extends AvroWrapper<D>>IOException
public void close()
throws IOException
close in interface org.apache.hadoop.io.serializer.Deserializer<T extends AvroWrapper<D>>IOExceptionprotected abstract T createAvroWrapper()
T (extends AvroWrapper) instance.
T instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||