Class VortexWriter.Builder

java.lang.Object
dev.vortex.api.VortexWriter.Builder
Enclosing class:
VortexWriter

public static final class VortexWriter.Builder extends Object
Configures and opens a VortexWriter. Everything required to open one is fixed by VortexWriter.builder(dev.vortex.api.Session, java.lang.String, org.apache.arrow.vector.types.pojo.Schema, org.apache.arrow.memory.BufferAllocator); the setters here are all optional.

Not thread-safe, and not reusable: each build() opens one file.

  • Method Details

    • options

      public VortexWriter.Builder options(Map<String,String> newOptions)
      Object-store credentials and options, replacing any set so far. Only the URI destination reaches a storage client, so this is rejected on a writer built over a NativeWritable.
    • putOption

      public VortexWriter.Builder putOption(String key, String value)
      Add a single object-store option. See options(Map).
    • metadata

      public VortexWriter.Builder metadata(Map<String,byte[]> newMetadata)
      User-defined metadata segments to store in the file footer, replacing any set so far.

      Values are opaque bytes, returned verbatim by NativeFiles.readMetadata. The native writer caps both the number of segments per file and the length of each key; the limits are enforced (and named in the error) by build(), rather than when the file is finalized.

    • putMetadata

      public VortexWriter.Builder putMetadata(String key, byte[] value)
      Add a single metadata segment. See metadata(Map).
    • build

      public VortexWriter build() throws IOException
      Open the writer.
      Throws:
      IOException - if the writer cannot be opened, including when the native side rejects the configured metadata