Package dev.vortex.api
Class VortexWriter
java.lang.Object
dev.vortex.api.VortexWriter
- All Implemented Interfaces:
AutoCloseable
Writer for Vortex files.
Batches are accepted via the Arrow C Data Interface: callers export an Arrow record batch to an ArrowArray
/ ArrowSchema pair and pass the addresses to writeBatch(long, long). The writer accepts up to four
in-flight batches on the session's runtime thread before back-pressuring the caller.
Call close() to flush remaining batches and finalize the file. If the writer becomes unreachable without
an explicit close(), VortexCleaner will flush and release native resources as a backstop — but
callers should always finalize explicitly so that I/O errors surface through the normal call path.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Flush any pending batches and finalize the file.static VortexWritercreate(Session session, String uri, org.apache.arrow.vector.types.pojo.Schema arrowSchema, Map<String, String> options, org.apache.arrow.memory.BufferAllocator allocator) Create a writer that streams records into the file aturi.voidwriteBatch(long arrowArrayAddr, long arrowSchemaAddr) Write a batch directly from Arrow C Data Interface addresses.
-
Method Details
-
create
public static VortexWriter create(Session session, String uri, org.apache.arrow.vector.types.pojo.Schema arrowSchema, Map<String, String> options, org.apache.arrow.memory.BufferAllocator allocator) throws IOExceptionCreate a writer that streams records into the file aturi. The path may be a full URI or a plain local filesystem path. The Arrow schema describes the exact layout of every batch written.- Throws:
IOException
-
writeBatch
Write a batch directly from Arrow C Data Interface addresses.- Throws:
IOException
-
close
Flush any pending batches and finalize the file. Idempotent.- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-