Package com.ocient.cli.extract
Class RecordExtractorFactory.WriterHandle
java.lang.Object
com.ocient.cli.extract.RecordExtractorFactory.WriterHandle
- Enclosing class:
- RecordExtractorFactory
public static class RecordExtractorFactory.WriterHandle extends Object
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 Type Method Description static RecordExtractorFactory.WriterHandleasync(int index, com.univocity.parsers.common.AbstractWriter<?> writer, CompletionStage<Void> onStreamClosed)intgetIndex()Returns the file indexcom.univocity.parsers.common.AbstractWriter<?>getWriter()Returns theAbstractWriterinstanceOptional<CompletionStage<Void>>onStreamClosed()Returns a future that completes when all resources from the writer have been releasedstatic RecordExtractorFactory.WriterHandlesync(int index, com.univocity.parsers.common.AbstractWriter<?> writer)
-
Method Details
-
sync
public static RecordExtractorFactory.WriterHandle sync(int index, com.univocity.parsers.common.AbstractWriter<?> writer) -
async
public static RecordExtractorFactory.WriterHandle async(int index, com.univocity.parsers.common.AbstractWriter<?> writer, CompletionStage<Void> onStreamClosed) -
getIndex
public int getIndex()Returns the file index -
getWriter
public com.univocity.parsers.common.AbstractWriter<?> getWriter()Returns theAbstractWriterinstance -
onStreamClosed
Returns a future that completes when all resources from the writer have been released
-