Package com.illumon.iris.db.v2.select
Class DbArrayChunkAdapter<ATTR extends Attributes.Any>
java.lang.Object
com.illumon.iris.db.v2.select.DbArrayChunkAdapter<ATTR>
- All Implemented Interfaces:
ChunkSource<ATTR>,ChunkSource.WithPrev<ATTR>,DefaultChunkSource<ATTR>,DefaultChunkSource.WithPrev<ATTR>,FillContextMaker,GetContextMaker
public class DbArrayChunkAdapter<ATTR extends Attributes.Any>
extends Object
implements DefaultChunkSource.WithPrev<ATTR>
This class wraps an inner ChunkSource holding a DbArray. The purpose of doing so is to apply DbArray#getDirect
to the underlying DbArray 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 DbArrayBase#getDirect() invoked on that value.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
ChunkSource.FillContext, ChunkSource.GetContext, ChunkSource.WithPrev<ATTR extends Attributes.Any>Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
DefaultChunkSource.SupportsContiguousGet<ATTR extends Attributes.Any>, DefaultChunkSource.WithPrev<ATTR extends Attributes.Any> -
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAYFields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfillChunk(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys orderedKeys) Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.voidfillPrevChunk(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys orderedKeys) Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.Get the most suitableChunkTypefor use with this ColumnSource.Class<?>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 com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeGetContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFilling, getPrevSourceMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContext
-
Constructor Details
-
DbArrayChunkAdapter
-
-
Method Details
-
getNativeType
- Specified by:
getNativeTypein interfaceChunkSource<ATTR extends Attributes.Any>
-
getChunkType
Description copied from interface:ChunkSourceGet the most suitableChunkTypefor use with this ColumnSource.- Specified by:
getChunkTypein interfaceChunkSource<ATTR extends Attributes.Any>- Returns:
- The ChunkType
-
fillChunk
public void fillChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull OrderedKeys orderedKeys) Description copied from interface:ChunkSourcePopulates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.- Specified by:
fillChunkin interfaceChunkSource<ATTR extends Attributes.Any>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according toorderedKeys. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,orderedKeys.size()).orderedKeys- AnOrderedKeysrepresenting the keys to be fetched
-
fillPrevChunk
public void fillPrevChunk(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull OrderedKeys orderedKeys) Description copied from interface:ChunkSource.WithPrevPopulates the given destination chunk with data corresponding to the keys from the givenOrderedKeys.- Specified by:
fillPrevChunkin interfaceChunkSource.WithPrev<ATTR extends Attributes.Any>- Parameters:
context- A context containing all mutable/state related data used in retrieving the Chunk.destination- The chunk to be populated according toorderedKeys. No assumptions shall be made about the size of the chunk shall be made. The chunk will be populated from position [0,orderedKeys.size()).orderedKeys- AnOrderedKeysrepresenting the keys to be fetched
-