org.apache.avro.hadoop.io
Class AvroSequenceFile.Reader.Options

java.lang.Object
  extended by 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
AvroSequenceFile.Reader.Options()
           
 
Method Summary
 org.apache.hadoop.conf.Configuration getConfiguration()
          Gets the Hadoop configuration.
 org.apache.hadoop.conf.Configuration getConfigurationWithAvroSerialization()
          Gets the Hadoop configuration with Avro serialization registered.
 org.apache.hadoop.fs.FileSystem getFileSystem()
          Gets the filesystem the SequenceFile should be read rom.
 org.apache.hadoop.fs.Path getInputPath()
          Gets the input path for the sequence file.
 AvroSequenceFile.Reader.Options withConfiguration(org.apache.hadoop.conf.Configuration conf)
          Sets the Hadoop configuration.
 AvroSequenceFile.Reader.Options withFileSystem(org.apache.hadoop.fs.FileSystem fileSystem)
          Sets the filesystem the SequenceFile should be read from.
 AvroSequenceFile.Reader.Options withInputPath(org.apache.hadoop.fs.Path inputPath)
          Sets the input path for the SequenceFile.
 AvroSequenceFile.Reader.Options withKeySchema(org.apache.avro.Schema keyReaderSchema)
          Sets the reader schema of the key records when using Avro data.
 AvroSequenceFile.Reader.Options withValueSchema(org.apache.avro.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

AvroSequenceFile.Reader.Options

public AvroSequenceFile.Reader.Options()
Method Detail

withFileSystem

public AvroSequenceFile.Reader.Options withFileSystem(org.apache.hadoop.fs.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(org.apache.hadoop.fs.Path inputPath)
Sets the input path for the SequenceFile.

Parameters:
inputPath - The input path.
Returns:
This options instance.

withConfiguration

public AvroSequenceFile.Reader.Options withConfiguration(org.apache.hadoop.conf.Configuration conf)
Sets the Hadoop configuration.

Parameters:
conf - The configuration.
Returns:
This options instance.

withKeySchema

public AvroSequenceFile.Reader.Options withKeySchema(org.apache.avro.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(org.apache.avro.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 org.apache.hadoop.fs.FileSystem getFileSystem()
Gets the filesystem the SequenceFile should be read rom.

Returns:
The file system to read from.

getInputPath

public org.apache.hadoop.fs.Path getInputPath()
Gets the input path for the sequence file.

Returns:
The input path.

getConfiguration

public org.apache.hadoop.conf.Configuration getConfiguration()
Gets the Hadoop configuration.

Returns:
The Hadoop configuration.

getConfigurationWithAvroSerialization

public org.apache.hadoop.conf.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-2013 The Apache Software Foundation. All Rights Reserved.