Class SingleElementListHeaderWriter
java.lang.Object
java.io.InputStream
io.deephaven.extensions.barrage.util.DefensiveDrainable
io.deephaven.extensions.barrage.chunk.ChunkWriter.DrainableColumn
io.deephaven.extensions.barrage.chunk.SingleElementListHeaderWriter
- All Implemented Interfaces:
io.grpc.Drainable
,Closeable
,AutoCloseable
The
SingleElementListHeaderWriter
is a specialized ChunkWriter.DrainableColumn
implementation that writes the
header for singleton list-wrapped columns in Apache Arrow record batches.
This writer ensures compatibility with Apache Arrow's format by providing the necessary metadata and offsets for a single-element list, while omitting unnecessary buffers such as validity buffers. It is designed to write the header information for a column where all rows are represented as a singleton list, with no null values.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
A defensive drainable needs to override available.int
drainTo
(OutputStream outputStream) int
Count the number of null elements in the outer-most layer of this column (i.e.void
visitBuffers
(ChunkWriter.BufferListener listener) Append the buffer boundaries to the flatbuffer payload via the supplied listener.void
visitFieldNodes
(ChunkWriter.FieldNodeListener listener) Append the field node to the flatbuffer payload via the supplied listener.Methods inherited from class io.deephaven.extensions.barrage.util.DefensiveDrainable
capture, read, read, read, skip
Methods inherited from class java.io.InputStream
close, mark, markSupported, nullInputStream, readAllBytes, readNBytes, readNBytes, reset, skipNBytes, transferTo
-
Constructor Details
-
SingleElementListHeaderWriter
public SingleElementListHeaderWriter(int numElements)
-
-
Method Details
-
visitFieldNodes
Description copied from class:ChunkWriter.DrainableColumn
Append the field node to the flatbuffer payload via the supplied listener.- Specified by:
visitFieldNodes
in classChunkWriter.DrainableColumn
- Parameters:
listener
- the listener to notify for each logical field node in this payload
-
visitBuffers
Description copied from class:ChunkWriter.DrainableColumn
Append the buffer boundaries to the flatbuffer payload via the supplied listener.- Specified by:
visitBuffers
in classChunkWriter.DrainableColumn
- Parameters:
listener
- the listener to notify for each sub-buffer in this payload
-
nullCount
public int nullCount()Description copied from class:ChunkWriter.DrainableColumn
Count the number of null elements in the outer-most layer of this column (i.e. does not count nested nulls inside of arrays)- Specified by:
nullCount
in classChunkWriter.DrainableColumn
- Returns:
- the number of null elements -- 'useDeephavenNulls' counts are always 0 so that we may omit the validity buffer
-
drainTo
- Throws:
IOException
-
available
Description copied from class:DefensiveDrainable
A defensive drainable needs to override available. As opposed to the genericInputStream
, this method must return the exact amount available.- Overrides:
available
in classDefensiveDrainable
- Returns:
- the exact amount available
- Throws:
IOException
- if an I/O exception occurs
-