Interface NativeReadable
- All Superinterfaces:
AutoCloseable,Closeable
Implementations bridge external I/O abstractions — for example Iceberg's FileIO input streams — into the
Vortex native reader. The native side invokes readFully(long, ByteBuffer) from its own worker threads,
potentially many calls concurrently, so implementations must be safe for concurrent positional reads (typically by
opening one underlying stream per concurrent call, or delegating to a positional-read API).
Lifecycle: the creator owns this object. Native code never calls Closeable.close(); close it only after every data
source or scan built on top of it has been closed.
-
Method Summary
Modifier and TypeMethodDescriptionlonglength()Total length of the source in bytes.name()Unique name of this source, typically its original location (URI or file path).voidreadFully(long position, ByteBuffer buffer) Read exactlybuffer.remaining()bytes starting at absolutepositionintobuffer.
-
Method Details
-
name
String name()Unique name of this source, typically its original location (URI or file path). Used to key per-session caches and in native error messages, so it must be stable and unique across sources; it must not contain glob characters (*?[). -
length
long length()Total length of the source in bytes. Must be cheap; called once when the source is registered. -
readFully
Read exactlybuffer.remaining()bytes starting at absolutepositionintobuffer.Unlike
InputStream.read(), short reads are not permitted: implementations must either fill the buffer completely (buffer.remaining() == 0on return) or throw.bufferis a directByteBufferwrapping native memory owned by the caller, so bytes written to it land in the native reader without an extra copy. It is valid only for the duration of this call: implementations must not retain a reference to it after returning. Implementations backed bybyte[]APIs can bulk-putinto it.- Throws:
EOFException- if the range extends past the end of the sourceIOException- if the underlying storage fails
-