public class JniWrapper extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
closeDataset(long datasetId)
Release the Dataset by destroying its reference held by JNI wrapper.
|
void |
closeDatasetFactory(long datasetFactoryId)
Release the DatasetFactory by destroying its reference held by JNI wrapper.
|
void |
closeScanner(long scannerId)
Release the Scanner by destroying its reference held by JNI wrapper.
|
long |
createDataset(long datasetFactoryId,
byte[] schema)
Create Dataset from a DatasetFactory and get the native pointer of the Dataset.
|
long |
createScanner(long datasetId,
String[] columns,
long batchSize,
long memoryPool)
Create Scanner from a Dataset and get the native pointer of the Dataset.
|
static JniWrapper |
get() |
byte[] |
getSchemaFromScanner(long scannerId)
Get a serialized schema from native instance of a Scanner.
|
byte[] |
inspectSchema(long datasetFactoryId)
Get a serialized schema from native instance of a DatasetFactory.
|
boolean |
nextRecordBatch(long scannerId,
long arrowArray)
Read next record batch from the specified scanner.
|
void |
releaseBuffer(long bufferId)
Release the Buffer by destroying its reference held by JNI wrapper.
|
public static JniWrapper get()
public void closeDatasetFactory(long datasetFactoryId)
datasetFactoryId - the native pointer of the arrow::dataset::DatasetFactory instance.public byte[] inspectSchema(long datasetFactoryId)
datasetFactoryId - the native pointer of the arrow::dataset::DatasetFactory instance.Schemapublic long createDataset(long datasetFactoryId,
byte[] schema)
datasetFactoryId - the native pointer of the arrow::dataset::DatasetFactory instance.schema - the predefined schema of the resulting Dataset.public void closeDataset(long datasetId)
datasetId - the native pointer of the arrow::dataset::Dataset instance.public long createScanner(long datasetId,
String[] columns,
long batchSize,
long memoryPool)
datasetId - the native pointer of the arrow::dataset::Dataset instance.columns - desired column names.
Columns not in this list will not be emitted when performing scan operation. Null equals
to "all columns".batchSize - batch size of scanned record batches.memoryPool - identifier of memory pool used in the native scanner.public byte[] getSchemaFromScanner(long scannerId)
scannerId - the native pointer of the arrow::dataset::Scanner instance.Schemapublic void closeScanner(long scannerId)
scannerId - the native pointer of the arrow::dataset::Scanner instance.public boolean nextRecordBatch(long scannerId,
long arrowArray)
scannerId - the native pointer of the arrow::dataset::Scanner instance.arrowArray - pointer to an empty ArrowArray struct to
store C++ side record batch that conforms to C data interface.public void releaseBuffer(long bufferId)
bufferId - the native pointer of the arrow::Buffer instance.Copyright © 2023 The Apache Software Foundation. All rights reserved.