public static class AvroSequenceFile.Writer.Options extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUFFER_SIZE_BYTES
The default write buffer size in bytes.
|
Constructor and Description |
---|
AvroSequenceFile.Writer.Options()
Creates a new
Options instance with default values. |
Modifier and Type | Method and Description |
---|---|
long |
getBlockSizeBytes()
Gets the desired size of the file blocks.
|
int |
getBufferSizeBytes()
Gets the desired size of the buffer used when flushing records to disk.
|
org.apache.hadoop.io.compress.CompressionCodec |
getCompressionCodec()
Gets the compression codec.
|
org.apache.hadoop.io.SequenceFile.CompressionType |
getCompressionType()
Gets the type of compression.
|
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 written to.
|
Class<?> |
getKeyClass()
Gets the class of the key records.
|
org.apache.hadoop.io.SequenceFile.Metadata |
getMetadata()
Gets the SequenceFile metadata to store in the header.
|
org.apache.hadoop.fs.Path |
getOutputPath()
Gets the output path for the sequence file.
|
org.apache.hadoop.util.Progressable |
getProgressable()
Gets the object to report progress to.
|
short |
getReplicationFactor()
Gets the desired number of replicas to store for each block of the file.
|
Class<?> |
getValueClass()
Gets the class of the value records.
|
AvroSequenceFile.Writer.Options |
withBlockSizeBytes(long bytes)
Sets the desired size of the file blocks.
|
AvroSequenceFile.Writer.Options |
withBufferSizeBytes(int bytes)
Sets the write buffer size in bytes.
|
AvroSequenceFile.Writer.Options |
withCompressionCodec(org.apache.hadoop.io.compress.CompressionCodec compressionCodec)
Sets the compression codec to use if it is enabled.
|
AvroSequenceFile.Writer.Options |
withCompressionType(org.apache.hadoop.io.SequenceFile.CompressionType compressionType)
Sets the type of compression.
|
AvroSequenceFile.Writer.Options |
withConfiguration(org.apache.hadoop.conf.Configuration conf)
Sets the Hadoop configuration.
|
AvroSequenceFile.Writer.Options |
withFileSystem(org.apache.hadoop.fs.FileSystem fileSystem)
Sets the filesystem the SequenceFile should be written to.
|
AvroSequenceFile.Writer.Options |
withKeyClass(Class<?> keyClass)
Sets the class of the key records to be written.
|
AvroSequenceFile.Writer.Options |
withKeySchema(Schema keyWriterSchema)
Sets the writer schema of the key records when using Avro data.
|
AvroSequenceFile.Writer.Options |
withMetadata(org.apache.hadoop.io.SequenceFile.Metadata metadata)
Sets the metadata that should be stored in the file header.
|
AvroSequenceFile.Writer.Options |
withOutputPath(org.apache.hadoop.fs.Path outputPath)
Sets the output path for the SequenceFile.
|
AvroSequenceFile.Writer.Options |
withProgressable(org.apache.hadoop.util.Progressable progressable)
Sets an object to report progress to.
|
AvroSequenceFile.Writer.Options |
withReplicationFactor(short replicationFactor)
Sets the desired replication factor for the file.
|
AvroSequenceFile.Writer.Options |
withValueClass(Class<?> valueClass)
Sets the class of the value records to be written.
|
AvroSequenceFile.Writer.Options |
withValueSchema(Schema valueWriterSchema)
Sets the writer schema of the value records when using Avro data.
|
public static final int DEFAULT_BUFFER_SIZE_BYTES
public AvroSequenceFile.Writer.Options()
Options
instance with default values.public AvroSequenceFile.Writer.Options withFileSystem(org.apache.hadoop.fs.FileSystem fileSystem)
fileSystem
- The filesystem.public AvroSequenceFile.Writer.Options withConfiguration(org.apache.hadoop.conf.Configuration conf)
conf
- The configuration.public AvroSequenceFile.Writer.Options withOutputPath(org.apache.hadoop.fs.Path outputPath)
outputPath
- The output path.public AvroSequenceFile.Writer.Options withKeyClass(Class<?> keyClass)
If the keys will be Avro data, use withKeySchema(org.apache.avro.Schema)
to specify the writer schema. The key
class will be automatically set to AvroKey
.
keyClass
- The key class.public AvroSequenceFile.Writer.Options withKeySchema(Schema keyWriterSchema)
The key class will automatically be set to AvroKey
, so there is no need to call withKeyClass(Class)
when using this method.
keyWriterSchema
- The writer schema for the keys.public AvroSequenceFile.Writer.Options withValueClass(Class<?> valueClass)
If the values will be Avro data, use withValueSchema(org.apache.avro.Schema)
to specify the writer schema. The value
class will be automatically set to AvroValue
.
valueClass
- The value class.public AvroSequenceFile.Writer.Options withValueSchema(Schema valueWriterSchema)
The value class will automatically be set to AvroValue
, so there is no need to call withValueClass(Class)
when using this method.
valueWriterSchema
- The writer schema for the values.public AvroSequenceFile.Writer.Options withBufferSizeBytes(int bytes)
bytes
- The desired buffer size.public AvroSequenceFile.Writer.Options withReplicationFactor(short replicationFactor)
replicationFactor
- The replication factor.public AvroSequenceFile.Writer.Options withBlockSizeBytes(long bytes)
bytes
- The desired block size in bytes.public AvroSequenceFile.Writer.Options withProgressable(org.apache.hadoop.util.Progressable progressable)
progressable
- A progressable object to track progress.public AvroSequenceFile.Writer.Options withCompressionType(org.apache.hadoop.io.SequenceFile.CompressionType compressionType)
compressionType
- The type of compression for the output file.public AvroSequenceFile.Writer.Options withCompressionCodec(org.apache.hadoop.io.compress.CompressionCodec compressionCodec)
compressionCodec
- The compression codec.public AvroSequenceFile.Writer.Options withMetadata(org.apache.hadoop.io.SequenceFile.Metadata metadata)
metadata
- The file metadata.public org.apache.hadoop.fs.FileSystem getFileSystem()
public org.apache.hadoop.conf.Configuration getConfiguration()
public org.apache.hadoop.conf.Configuration getConfigurationWithAvroSerialization()
public org.apache.hadoop.fs.Path getOutputPath()
public Class<?> getKeyClass()
public Class<?> getValueClass()
public int getBufferSizeBytes()
public short getReplicationFactor()
public long getBlockSizeBytes()
public org.apache.hadoop.util.Progressable getProgressable()
public org.apache.hadoop.io.SequenceFile.CompressionType getCompressionType()
public org.apache.hadoop.io.compress.CompressionCodec getCompressionCodec()
public org.apache.hadoop.io.SequenceFile.Metadata getMetadata()
Copyright © 2009-2013 The Apache Software Foundation. All Rights Reserved.