public static class AvroSequenceFile.Writer.Options extends Object
Constructor and Description |
---|
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.
|
CompressionCodec |
getCompressionCodec()
Gets the compression codec.
|
SequenceFile.CompressionType |
getCompressionType()
Gets the type of compression.
|
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 written to.
|
Class<?> |
getKeyClass()
Gets the class of the key records.
|
SequenceFile.Metadata |
getMetadata()
Gets the SequenceFile metadata to store in the header.
|
Path |
getOutputPath()
Gets the output path for the sequence file.
|
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(CompressionCodec compressionCodec)
Sets the compression codec to use if it is enabled.
|
AvroSequenceFile.Writer.Options |
withCompressionType(SequenceFile.CompressionType compressionType)
Sets the type of compression.
|
AvroSequenceFile.Writer.Options |
withConfiguration(Configuration conf)
Sets the Hadoop configuration.
|
AvroSequenceFile.Writer.Options |
withFileSystem(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(SequenceFile.Metadata metadata)
Sets the metadata that should be stored in the file header.
|
AvroSequenceFile.Writer.Options |
withOutputPath(Path outputPath)
Sets the output path for the SequenceFile.
|
AvroSequenceFile.Writer.Options |
withProgressable(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 AvroSequenceFile.Writer.Options withFileSystem(FileSystem fileSystem)
fileSystem
- The filesystem.public AvroSequenceFile.Writer.Options withConfiguration(Configuration conf)
conf
- The configuration.public AvroSequenceFile.Writer.Options withOutputPath(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(Progressable progressable)
progressable
- A progressable object to track progress.public AvroSequenceFile.Writer.Options withCompressionType(SequenceFile.CompressionType compressionType)
compressionType
- The type of compression for the output file.public AvroSequenceFile.Writer.Options withCompressionCodec(CompressionCodec compressionCodec)
compressionCodec
- The compression codec.public AvroSequenceFile.Writer.Options withMetadata(SequenceFile.Metadata metadata)
metadata
- The file metadata.public FileSystem getFileSystem()
public Configuration getConfiguration()
public Configuration getConfigurationWithAvroSerialization()
public Path getOutputPath()
public Class<?> getKeyClass()
public Class<?> getValueClass()
public int getBufferSizeBytes()
public short getReplicationFactor()
public long getBlockSizeBytes()
public Progressable getProgressable()
public SequenceFile.CompressionType getCompressionType()
public CompressionCodec getCompressionCodec()
public SequenceFile.Metadata getMetadata()
Copyright © 2009–2020 The Apache Software Foundation. All rights reserved.