org.apache.avro.hadoop.io

## 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 Summary

    Constructors
    Constructor and Description
    `Options()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Configuration` | `getConfiguration()` Gets the Hadoop configuration.
    `Configuration` | `getConfigurationWithAvroSerialization()` Gets the Hadoop configuration with Avro serialization registered.
    `FileSystem` | `getFileSystem()` Gets the filesystem the SequenceFile should be read rom.
    `Path` | `getInputPath()` Gets the input path for the sequence file.
    `AvroSequenceFile.Reader.Options` | `withConfiguration(Configuration conf)` Sets the Hadoop configuration.
    `AvroSequenceFile.Reader.Options` | `withFileSystem(FileSystem fileSystem)` Sets the filesystem the SequenceFile should be read from.
    `AvroSequenceFile.Reader.Options` | `withInputPath(Path inputPath)` Sets the input path for the SequenceFile.
    `AvroSequenceFile.Reader.Options` | `withKeySchema(Schema keyReaderSchema)` Sets the reader schema of the key records when using Avro data.
    `AvroSequenceFile.Reader.Options` | `withValueSchema(Schema valueReaderSchema)` Sets the reader schema of the value records when using Avro data.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Options

          public Options()

  - ### Method Detail

    - #### 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.

Copyright © 2009–2024 The Apache Software Foundation. All rights reserved.