public class AvroSequenceFile extends Object
SequenceFilethat also supports reading and writing Avro data.
The vanilla Hadoop
SequenceFile contains a header
followed by a sequence of records. A record consists of a
key and a value. The key and value must either:
Serializationregistered with the
Since Avro data are Plain Old Java Objects (e.g.,
data with schema "int"), they do not implement Writable.
implementation cannot determine whether an object instance of type
CharSequence that also implements
be serialized using Avro or WritableSerialization.
The solution implemented in
AvroSequenceFile is to:
SerializationFactory, which will accept only objects that are instances of either
|Modifier and Type||Class and Description|
A reader for SequenceFiles that may contain Avro data.
A writer for an uncompressed SequenceFile that supports Avro data.
|Modifier and Type||Field and Description|
The SequenceFile.Metadata field for the Avro key writer schema.
The SequenceFile.Metadata field for the Avro value writer schema.
|Modifier and Type||Method and Description|
Creates a writer from a set of options.
public static final org.apache.hadoop.io.Text METADATA_FIELD_KEY_SCHEMA
public static final org.apache.hadoop.io.Text METADATA_FIELD_VALUE_SCHEMA
public static org.apache.hadoop.io.SequenceFile.Writer createWriter(AvroSequenceFile.Writer.Options options) throws IOException
Since there are different implementations of
Writer depending on
the compression type, this method constructs the appropriate subclass
depending on the compression type given in the
options- The options for the writer.
IOException- If the writer cannot be created.
Copyright © 2009–2021 The Apache Software Foundation. All rights reserved.