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 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