Package dev.vortex.jni
Class NativeWriter
java.lang.Object
dev.vortex.jni.NativeWriter
JNI boundary for
VortexWriter.-
Method Summary
Modifier and TypeMethodDescriptionstatic longbufferedBytes(long writerPointer) Number of uncompressed bytes buffered by the native writer that have not yet reached the sink.static longbytesWritten(long writerPointer) Number of bytes successfully written to the underlying sink so far.static voidclose(long writerPointer) Flush and close the writer.static longcreate(long sessionPointer, String uri, long arrowSchemaAddress, Map<String, String> options, Map<String, byte[]> metadata) Open a writer aturithat accepts batches matching the Arrow schema atarrowSchemaAddress.static longcreateStream(long sessionPointer, Object writable, long arrowSchemaAddress, Map<String, byte[]> metadata) Open a writer that streams the file into a caller-providedNativeWritable.static VortexWriteSummaryfinish(long writerPointer) Flush and close the writer, returning its completed-file summary.static booleanwriteBatch(long writerPointer, long arrowArrayAddress, long arrowSchemaAddress) Write a batch directly from Arrow C Data Interface addresses.
-
Method Details
-
create
public static long create(long sessionPointer, String uri, long arrowSchemaAddress, Map<String, String> options, Map<String, byte[]> metadata) Open a writer aturithat accepts batches matching the Arrow schema atarrowSchemaAddress.- 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-providedNativeWritable. The native side writes and flushes but never closes the writable; the caller must close it afterclose(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 fromcreate(long, java.lang.String, long, java.util.Map<java.lang.String, java.lang.String>, java.util.Map<java.lang.String, byte[]>)arrowArrayAddress- address of anArrowArraystructarrowSchemaAddress- address of anArrowSchemastruct- Returns:
trueon 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
Flush and close the writer, returning its completed-file summary. Must be called exactly once.
-