Class NativeWriter

java.lang.Object
dev.vortex.jni.NativeWriter

public final class NativeWriter extends Object
JNI boundary for VortexWriter.
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    bufferedBytes(long writerPointer)
    Number of uncompressed bytes buffered by the native writer that have not yet reached the sink.
    static long
    bytesWritten(long writerPointer)
    Number of bytes successfully written to the underlying sink so far.
    static void
    close(long writerPointer)
    Flush and close the writer.
    static long
    create(long sessionPointer, String uri, long arrowSchemaAddress, Map<String,String> options, Map<String,byte[]> metadata)
    Open a writer at uri that accepts batches matching the Arrow schema at arrowSchemaAddress.
    static long
    createStream(long sessionPointer, Object writable, long arrowSchemaAddress, Map<String,byte[]> metadata)
    Open a writer that streams the file into a caller-provided NativeWritable.
    finish(long writerPointer)
    Flush and close the writer, returning its completed-file summary.
    static boolean
    writeBatch(long writerPointer, long arrowArrayAddress, long arrowSchemaAddress)
    Write a batch directly from Arrow C Data Interface addresses.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • create

      public static long create(long sessionPointer, String uri, long arrowSchemaAddress, Map<String,String> options, Map<String,byte[]> metadata)
      Open a writer at uri that accepts batches matching the Arrow schema at arrowSchemaAddress.
      Parameters:
      metadata - user-defined metadata segments to store in the file footer (may be null)
    • createStream

      public static long createStream(long sessionPointer, Object writable, long arrowSchemaAddress, Map<String,byte[]> metadata)
      Open a writer that streams the file into a caller-provided NativeWritable. The native side writes and flushes but never closes the writable; the caller must close it after close(long).
      Parameters:
      metadata - user-defined metadata segments to store in the file footer (may be null)
    • writeBatch

      public static boolean writeBatch(long writerPointer, long arrowArrayAddress, long arrowSchemaAddress)
      Write a batch directly from Arrow C Data Interface addresses.
      Parameters:
      writerPointer - pointer from create(long, java.lang.String, long, java.util.Map<java.lang.String, java.lang.String>, java.util.Map<java.lang.String, byte[]>)
      arrowArrayAddress - address of an ArrowArray struct
      arrowSchemaAddress - address of an ArrowSchema struct
      Returns:
      true on success
    • bytesWritten

      public static long bytesWritten(long writerPointer)
      Number of bytes successfully written to the underlying sink so far.
    • bufferedBytes

      public static long bufferedBytes(long writerPointer)
      Number of uncompressed bytes buffered by the native writer that have not yet reached the sink.
    • close

      public static void close(long writerPointer)
      Flush and close the writer. Must be called exactly once.
    • finish

      public static VortexWriteSummary finish(long writerPointer)
      Flush and close the writer, returning its completed-file summary. Must be called exactly once.