T
- The type of the elements that are being written by the sink.public interface Writer<T> extends Serializable
Writer
is used in conjunction with a
RollingSink
to perform the actual
writing to the bucket files.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
Writer . |
Writer<T> |
duplicate()
Duplicates the
Writer . |
void |
flush()
Flushes out any internally held data.
|
void |
open(org.apache.hadoop.fs.FSDataOutputStream outStream)
Initializes the
Writer for a newly opened bucket file. |
void |
write(T element)
Writes one element to the bucket file.
|
void open(org.apache.hadoop.fs.FSDataOutputStream outStream) throws IOException
Writer
for a newly opened bucket file.
Any internal per-bucket initialization should be performed here.outStream
- The FSDataOutputStream
for the newly opened file.IOException
void flush() throws IOException
IOException
void close() throws IOException
Writer
. This must not close the FSDataOutputStream
that
was handed in in the open(org.apache.hadoop.fs.FSDataOutputStream)
method. Only internally held state should be
closed.IOException
void write(T element) throws IOException
IOException
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.