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_ARRAY
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAY
-
Constructor Summary
Constructors Constructor Description DbArrayChunkAdapter(ChunkSource.WithPrev<ATTR> underlying)
-
Method Summary
Modifier and Type Method Description void
fillChunk(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys orderedKeys)
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.void
fillPrevChunk(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys orderedKeys)
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.ChunkType
getChunkType()
Get the most suitableChunkType
for use with this ColumnSource.Class<?>
getNativeType()
ChunkSource.FillContext
makeFillContext(int chunkCapacity, SharedContext sharedContext)
Allocate a newChunkSource.FillContext
for filling chunks from thisFillContextMaker
, typically aChunkSource
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFilling, getPrevSource
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContext
-
Constructor Details
-
Method Details
-
getNativeType
- Specified by:
getNativeType
in interfaceChunkSource<ATTR extends Attributes.Any>
-
getChunkType
Description copied from interface:ChunkSource
Get the most suitableChunkType
for use with this ColumnSource.- Specified by:
getChunkType
in 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:ChunkSource
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.- Specified by:
fillChunk
in 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
- AnOrderedKeys
representing 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.WithPrev
Populates the given destination chunk with data corresponding to the keys from the givenOrderedKeys
.- Specified by:
fillPrevChunk
in 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
- AnOrderedKeys
representing the keys to be fetched
-
makeFillContext
Description copied from interface:FillContextMaker
Allocate a newChunkSource.FillContext
for filling chunks from thisFillContextMaker
, typically aChunkSource
.- Specified by:
makeFillContext
in interfaceDefaultChunkSource<ATTR extends Attributes.Any>
- Specified by:
makeFillContext
in interfaceFillContextMaker
- Parameters:
chunkCapacity
- The maximum size of anyWritableChunk
that will be filled with this contextsharedContext
- Shared store of intermediate results.- Returns:
- A context for use with fill operations
-