Class VectorChunkAdapter<ATTR extends Any>
java.lang.Object
io.deephaven.engine.table.impl.select.VectorChunkAdapter<ATTR>
- All Implemented Interfaces:
ChunkSource<ATTR>,ChunkSource.WithPrev<ATTR>,FillContextMaker,GetContextMaker,DefaultChunkSource<ATTR>,DefaultChunkSource.WithPrev<ATTR>
public class VectorChunkAdapter<ATTR extends Any>
extends Object
implements DefaultChunkSource.WithPrev<ATTR>
This class wraps an inner ChunkSource holding a Vector. The purpose of doing so is to apply Vector#getDirect to the
underlying Vector values returned by the underlying ChunkSource. This is the strategy for implementing this class:
makeGetContext() - doesn't need to change. The default implementation in our parent, namely
DefaultChunkSource#makeGetContext, already does the right thing. getChunk() - likewise. makeFillContext() - We don't
need to add anything to the "inner" context, so we just delegate to inner and return its context fillContext() - We
first let the inner fill the chunk, then we overwrite each value (where non-null) with the result of
Vector#getDirect() invoked on that value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.deephaven.engine.table.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Any>Nested classes/interfaces inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Any>, DefaultChunkSource.WithPrev<ATTR extends Any> -
Field Summary
Fields inherited from interface io.deephaven.engine.table.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAYFields inherited from interface io.deephaven.engine.table.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull RowSequence rowSequence) Populates the given destination chunk with data corresponding to the keys from the givenRowSequence.voidfillPrevChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull RowSequence rowSequence) Populates the given destination chunk with data corresponding to the keys from the givenRowSequence.Get the most suitableChunkTypefor use with this ChunkSource.makeFillContext(int chunkCapacity, SharedContext sharedContext) Allocate a newChunkSource.FillContextfor filling chunks from thisFillContextMaker, typically aChunkSource.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeGetContextMethods inherited from interface io.deephaven.engine.table.impl.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFilling, getPrevSourceMethods inherited from interface io.deephaven.engine.table.FillContextMaker
makeFillContextMethods inherited from interface io.deephaven.engine.table.GetContextMaker
makeGetContext
-
Constructor Details
-
VectorChunkAdapter
-
-
Method Details
-
getChunkType
Description copied from interface:ChunkSourceGet the most suitableChunkTypefor use with this ChunkSource.- Specified by:
getChunkTypein interfaceChunkSource<ATTR extends Any>- Returns:
- The ChunkType
-
fillChunk
public void fillChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super ATTR> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSourcePopulates the given destination chunk with data corresponding to the keys from the givenRowSequence.- Specified by:
fillChunkin interfaceChunkSource<ATTR extends Any>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according torowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).rowSequence- AnRowSequencerepresenting the keys to be fetched
-
fillPrevChunk
public void fillPrevChunk(@NotNull @NotNull ChunkSource.FillContext context, @NotNull @NotNull WritableChunk<? super ATTR> destination, @NotNull @NotNull RowSequence rowSequence) Description copied from interface:ChunkSource.WithPrevPopulates the given destination chunk with data corresponding to the keys from the givenRowSequence.- Specified by:
fillPrevChunkin interfaceChunkSource.WithPrev<ATTR extends Any>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according torowSequence. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,rowSequence.size()).rowSequence- AnRowSequencerepresenting the keys to be fetched
-