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 `ResultSetExtractor`s to begin extracting to the next file before the current file has closed.

## Method Summary

Modifier and Type
Method
Description
`static RecordExtractorFactory.WriterHandle`
`async(int index, com.univocity.parsers.common.AbstractWriter<?> writer, Writer unformattedSink, CompletionStage<Void> onStreamClosed)`
`int`
`getIndex()`
Returns the file index
`Writer`
`getUnformattedSink()`
`com.univocity.parsers.common.AbstractWriter<?>`
`getWriter()`
Returns the `AbstractWriter` instance
`Optional<CompletionStage<Void>>`
`onStreamClosed()`
Returns a future that completes when all resources from the writer have been released
`static RecordExtractorFactory.WriterHandle`
`sync(int index, com.univocity.parsers.common.AbstractWriter<?> writer, Writer unformattedSink)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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 the `AbstractWriter` instance

### getUnformattedSink

public Writer getUnformattedSink()

### onStreamClosed

public Optional<CompletionStage<Void>> onStreamClosed()
Returns a future that completes when all resources from the writer have been released