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.IOExceptionvoid flush()
throws IOException
IOExceptionvoid 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.IOExceptionvoid write(T element) throws IOException
IOExceptionCopyright © 2014–2016 The Apache Software Foundation. All rights reserved.