K
- The type of the first tuple field.V
- The type of the second tuple field.@Deprecated public class SequenceFileWriter<K extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable> extends StreamWriterBase<Tuple2<K,V>> implements InputTypeConfigurable
Writer
that writes the bucket files as Hadoop SequenceFiles
.
The input to the BucketingSink
must
be a Tuple2
of two Hadoop
Writables
.Modifier | Constructor and Description |
---|---|
|
SequenceFileWriter()
Deprecated.
Creates a new
SequenceFileWriter that writes sequence files without compression. |
protected |
SequenceFileWriter(SequenceFileWriter<K,V> other)
Deprecated.
|
|
SequenceFileWriter(String compressionCodecName,
org.apache.hadoop.io.SequenceFile.CompressionType compressionType)
Deprecated.
Creates a new
SequenceFileWriter that writes sequence with the given
compression codec and compression type. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Deprecated.
Closes the
Writer . |
SequenceFileWriter<K,V> |
duplicate()
Deprecated.
Duplicates the
Writer . |
void |
open(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path)
Deprecated.
Initializes the
Writer for a newly opened bucket file. |
void |
setInputType(TypeInformation<?> type,
ExecutionConfig executionConfig)
Deprecated.
Method that is called on an
OutputFormat when it is passed to
the DataSet's output method. |
void |
write(Tuple2<K,V> element)
Deprecated.
Writes one element to the bucket file.
|
flush, getPos, getStream, isSyncOnFlush, setSyncOnFlush
public SequenceFileWriter()
SequenceFileWriter
that writes sequence files without compression.public SequenceFileWriter(String compressionCodecName, org.apache.hadoop.io.SequenceFile.CompressionType compressionType)
SequenceFileWriter
that writes sequence with the given
compression codec and compression type.compressionCodecName
- Name of a Hadoop Compression Codec.compressionType
- The compression type to use.protected SequenceFileWriter(SequenceFileWriter<K,V> other)
public void open(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path) throws IOException
Writer
Writer
for a newly opened bucket file.
Any internal per-bucket initialization should be performed here.open
in interface Writer<Tuple2<K extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable>>
open
in class StreamWriterBase<Tuple2<K extends org.apache.hadoop.io.Writable,V extends org.apache.hadoop.io.Writable>>
fs
- The FileSystem
containing the newly opened file.path
- The Path
of the newly opened file.IOException
public void close() throws IOException
Writer
Writer
. If the writer is already closed, no action will be
taken. The call should close all state related to the current output file,
including the output stream opened in open
.public void write(Tuple2<K,V> element) throws IOException
Writer
public void setInputType(TypeInformation<?> type, ExecutionConfig executionConfig)
InputTypeConfigurable
OutputFormat
when it is passed to
the DataSet's output method. May be used to configures the output format based on the data type.setInputType
in interface InputTypeConfigurable
type
- The data type of the input.executionConfig
- The execution config for this parallel execution.public SequenceFileWriter<K,V> duplicate()
Writer
Writer
. This is used to get one Writer
for each
parallel instance of the sink.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.