Package dev.vortex.api
Interface VortexWriter
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
JNIWriter
Writer for creating Vortex files from Arrow data.
This class provides methods to write Arrow VectorSchemaRoot batches to Vortex format files.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the writer and finalizes the Vortex file.static VortexWriterCreates a new VortexWriter for writing to the specified file path.voidwriteBatch(byte[] arrowData) Writes a batch of Arrow data to the Vortex file.voidwriteBatchFfi(long arrowArrayAddr, long arrowSchemaAddr) Writes a batch of Arrow data directly from Arrow C Data Interface pointers.
-
Method Details
-
create
Creates a new VortexWriter for writing to the specified file path.- Parameters:
uri- The URI for where the file is openeddtype- The Vortex DType for data that gets writtenoptions- additional writer options- Returns:
- a new VortexWriter instance
- Throws:
IOException- if the writer cannot be created
-
writeBatch
Writes a batch of Arrow data to the Vortex file.- Parameters:
arrowData- the Arrow data in IPC format as byte array- Throws:
IOException- if writing fails
-
writeBatchFfi
Writes a batch of Arrow data directly from Arrow C Data Interface pointers.This avoids the IPC serialization overhead by accepting raw memory addresses of ArrowArray and ArrowSchema structs.
- Parameters:
arrowArrayAddr- memory address of the ArrowArray structarrowSchemaAddr- memory address of the ArrowSchema struct- Throws:
IOException- if writing fails
-
close
Closes the writer and finalizes the Vortex file.This method must be called to ensure the file is properly written with all necessary metadata and footers.
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException- if closing fails
-