Class SingleElementListHeaderInputStreamGenerator
java.lang.Object
java.io.InputStream
io.deephaven.extensions.barrage.util.DefensiveDrainable
io.deephaven.extensions.barrage.chunk.ChunkInputStreamGenerator.DrainableColumn
io.deephaven.extensions.barrage.chunk.SingleElementListHeaderInputStreamGenerator
- All Implemented Interfaces:
io.grpc.Drainable
,Closeable
,AutoCloseable
public class SingleElementListHeaderInputStreamGenerator
extends ChunkInputStreamGenerator.DrainableColumn
This helper class is used to generate only the header of an arrow list that contains a single element.
-
Constructor Summary
-
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
Append the buffer boundaries to the flatbuffer payload via the supplied listener.void
Append the field nde 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
-
SingleElementListHeaderInputStreamGenerator
public SingleElementListHeaderInputStreamGenerator(int numElements)
-
-
Method Details
-
visitFieldNodes
Description copied from class:ChunkInputStreamGenerator.DrainableColumn
Append the field nde to the flatbuffer payload via the supplied listener.- Specified by:
visitFieldNodes
in classChunkInputStreamGenerator.DrainableColumn
- Parameters:
listener
- the listener to notify for each logical field node in this payload
-
visitBuffers
Description copied from class:ChunkInputStreamGenerator.DrainableColumn
Append the buffer boundaries to the flatbuffer payload via the supplied listener.- Specified by:
visitBuffers
in classChunkInputStreamGenerator.DrainableColumn
- Parameters:
listener
- the listener to notify for each sub-buffer in this payload
-
nullCount
public int nullCount()Description copied from class:ChunkInputStreamGenerator.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 classChunkInputStreamGenerator.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
-