Package com.ocient.cli.extract
Class RecordExtractorFactory.WriterHandle
java.lang.Object
com.ocient.cli.extract.RecordExtractorFactory.WriterHandle
- Enclosing class:
RecordExtractorFactory
Born out of a need to parallelize Amazon S3 Multi-Part Uploads through a number of synchronous
OutputStream and AbstractWriter implementations. The handle provides a
mechanism allowing backing impls to close asynchronously. For an S3 stream, this means
uploading any remaining parts and sending the complete message. Doing this asynchronously
allows ResultSetExtractors to begin extracting to the next file before the current file
has closed.-
Method Summary
Modifier and TypeMethodDescriptionasync(int index, com.univocity.parsers.common.AbstractWriter<?> writer, Writer unformattedSink, CompletionStage<Void> onStreamClosed) intgetIndex()Returns the file indexcom.univocity.parsers.common.AbstractWriter<?> Returns theAbstractWriterinstanceReturns a future that completes when all resources from the writer have been released
-
Method Details
-
sync
public static RecordExtractorFactory.WriterHandle sync(int index, com.univocity.parsers.common.AbstractWriter<?> writer, Writer unformattedSink) -
async
public static RecordExtractorFactory.WriterHandle async(int index, com.univocity.parsers.common.AbstractWriter<?> writer, Writer unformattedSink, CompletionStage<Void> onStreamClosed) -
getIndex
public int getIndex()Returns the file index -
getWriter
public com.univocity.parsers.common.AbstractWriter<?> getWriter()Returns theAbstractWriterinstance -
getUnformattedSink
-
onStreamClosed
Returns a future that completes when all resources from the writer have been released
-