java.lang.Object
org.apache.arrow.c.ArrowArray
- All Implemented Interfaces:
AutoCloseable,BaseStruct
C Data Interface ArrowArray.
Represents a wrapper for the following C structure:
struct ArrowArray {
// Array data description
int64_t length;
int64_t null_count;
int64_t offset;
int64_t n_buffers;
int64_t n_children;
const void** buffers;
struct ArrowArray** children;
struct ArrowArray* dictionary;
// Release callback
void (*release)(struct ArrowArray*);
// Opaque producer-specific data
void* private_data;
};
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSnapshot of the ArrowArray raw data. -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrowArrayallocateNew(BufferAllocator allocator) Create ArrowArray by allocating memory.voidclose()Close to release the main buffer.voidMark the array as released.longGet memory address.voidrelease()Call the release callback of an ArrowArray.voidsave(ArrowArray.Snapshot snapshot) Write values from Snapshot to the underlying ArrowArray memory buffer.snapshot()Take a snapshot of the ArrowArray raw values.static ArrowArraywrap(long memoryAddress) Create ArrowArray from an existing memory address.
-
Method Details
-
wrap
Create ArrowArray from an existing memory address.The resulting ArrowArray does not own the memory.
- Parameters:
memoryAddress- Memory address to wrap- Returns:
- A new ArrowArray instance
-
allocateNew
Create ArrowArray by allocating memory.The resulting ArrowArray owns the memory.
- Parameters:
allocator- Allocator for memory allocations- Returns:
- A new ArrowArray instance
-
markReleased
public void markReleased()Mark the array as released. -
memoryAddress
public long memoryAddress()Description copied from interface:BaseStructGet memory address.- Specified by:
memoryAddressin interfaceBaseStruct- Returns:
- Memory address
-
release
public void release()Description copied from interface:BaseStructCall the release callback of an ArrowArray.This function must not be called for child arrays.
- Specified by:
releasein interfaceBaseStruct
-
close
public void close()Description copied from interface:BaseStructClose to release the main buffer.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceBaseStruct
-
snapshot
Take a snapshot of the ArrowArray raw values.- Returns:
- snapshot
-
save
Write values from Snapshot to the underlying ArrowArray memory buffer.
-