T- The type of element to write.
public class NoCompressionBulkWriter<T> extends Object implements BulkWriter<T>
BulkWriterimplementation that does not compress data. This is essentially a no-op writer for use with
CompressWriterFactoryfor the case that no compression codec is specified.
|Constructor and Description|
|Modifier and Type||Method and Description|
Adds an element to the encoder.
Finishes the writing.
Flushes all intermediate buffered data to the output stream.
public NoCompressionBulkWriter(FSDataOutputStream outputStream, Extractor<T> extractor)
public void addElement(T element) throws IOException
It may be that adding this element fills up an internal buffer and causes the encoding and flushing of a batch of internally buffered elements.
element- The element to add.
IOException- Thrown, if the element cannot be added to the encoder, or if the output stream throws an exception.
public void flush() throws IOException
IOException- Thrown if the encoder cannot be flushed, or if the output stream throws an exception.
public void finish() throws IOException
The writer is not expected to handle any more records via
after this method is called.
Important: This method MUST NOT close the stream that the writer writes to. Closing the stream is expected to happen through the invoker of this method afterwards.
IOException- Thrown if the finalization fails.
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.