K
- The type of key to write. It should be writable.V
- The type of value to write. It should be writable.@PublicEvolving public class SequenceFileWriterFactory<K extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable> extends Object implements BulkWriter.Factory<Tuple2<K,V>>
BulkWriter
.Modifier and Type | Field and Description |
---|---|
static String |
NO_COMPRESSION
A constant specifying that no compression is requested.
|
Constructor and Description |
---|
SequenceFileWriterFactory(Configuration hadoopConf,
Class<K> keyClass,
Class<V> valueClass)
Creates a new SequenceFileWriterFactory using the given builder to assemble the
SequenceFileWriter.
|
SequenceFileWriterFactory(Configuration hadoopConf,
Class<K> keyClass,
Class<V> valueClass,
String compressionCodecName)
Creates a new SequenceFileWriterFactory using the given builder to assemble the
SequenceFileWriter.
|
SequenceFileWriterFactory(Configuration hadoopConf,
Class<K> keyClass,
Class<V> valueClass,
String compressionCodecName,
org.apache.hadoop.io.SequenceFile.CompressionType compressionType)
Creates a new SequenceFileWriterFactory using the given builder to assemble the
SequenceFileWriter.
|
Modifier and Type | Method and Description |
---|---|
SequenceFileWriter<K,V> |
create(FSDataOutputStream out)
Creates a writer that writes to the given stream.
|
public static final String NO_COMPRESSION
public SequenceFileWriterFactory(Configuration hadoopConf, Class<K> keyClass, Class<V> valueClass)
hadoopConf
- The Hadoop configuration for Sequence File Writer.keyClass
- The class of key to write.valueClass
- The class of value to write.public SequenceFileWriterFactory(Configuration hadoopConf, Class<K> keyClass, Class<V> valueClass, String compressionCodecName)
hadoopConf
- The Hadoop configuration for Sequence File Writer.keyClass
- The class of key to write.valueClass
- The class of value to write.compressionCodecName
- The name of compression codec.public SequenceFileWriterFactory(Configuration hadoopConf, Class<K> keyClass, Class<V> valueClass, String compressionCodecName, org.apache.hadoop.io.SequenceFile.CompressionType compressionType)
hadoopConf
- The Hadoop configuration for Sequence File Writer.keyClass
- The class of key to write.valueClass
- The class of value to write.compressionCodecName
- The name of compression codec.compressionType
- The type of compression level.public SequenceFileWriter<K,V> create(FSDataOutputStream out) throws IOException
BulkWriter.Factory
create
in interface BulkWriter.Factory<Tuple2<K extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable>>
out
- The output stream to write the encoded data to.IOException
- Thrown if the writer cannot be opened, or if the output
stream throws an exception.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.