Class AvroSequenceFile.Reader.Options

java.lang.Object
org.apache.avro.hadoop.io.AvroSequenceFile.Reader.Options
Enclosing class:
AvroSequenceFile.Reader

public static class AvroSequenceFile.Reader.Options extends Object
A helper class to encapsulate the options that can be used to construct a Reader.
  • Constructor Details

    • Options

      public Options()
  • Method Details

    • withFileSystem

      public AvroSequenceFile.Reader.Options withFileSystem(FileSystem fileSystem)
      Sets the filesystem the SequenceFile should be read from.
      Parameters:
      fileSystem - The filesystem.
      Returns:
      This options instance.
    • withInputPath

      public AvroSequenceFile.Reader.Options withInputPath(Path inputPath)
      Sets the input path for the SequenceFile.
      Parameters:
      inputPath - The input path.
      Returns:
      This options instance.
    • withConfiguration

      public AvroSequenceFile.Reader.Options withConfiguration(Configuration conf)
      Sets the Hadoop configuration.
      Parameters:
      conf - The configuration.
      Returns:
      This options instance.
    • withKeySchema

      public AvroSequenceFile.Reader.Options withKeySchema(Schema keyReaderSchema)
      Sets the reader schema of the key records when using Avro data.

      If not set, the writer schema will be used as the reader schema.

      Parameters:
      keyReaderSchema - The reader schema for the keys.
      Returns:
      This options instance.
    • withValueSchema

      public AvroSequenceFile.Reader.Options withValueSchema(Schema valueReaderSchema)
      Sets the reader schema of the value records when using Avro data.

      If not set, the writer schema will be used as the reader schema.

      Parameters:
      valueReaderSchema - The reader schema for the values.
      Returns:
      This options instance.
    • getFileSystem

      public FileSystem getFileSystem()
      Gets the filesystem the SequenceFile should be read rom.
      Returns:
      The file system to read from.
    • getInputPath

      public Path getInputPath()
      Gets the input path for the sequence file.
      Returns:
      The input path.
    • getConfiguration

      public Configuration getConfiguration()
      Gets the Hadoop configuration.
      Returns:
      The Hadoop configuration.
    • getConfigurationWithAvroSerialization

      public Configuration getConfigurationWithAvroSerialization() throws IOException
      Gets the Hadoop configuration with Avro serialization registered.
      Returns:
      The Hadoop configuration.
      Throws:
      IOException - If there is an error configuring Avro serialization.