Interface PagingChunkSource<ATTR extends Attributes.Any>
- All Superinterfaces:
ChunkSource<ATTR>
,FillContextMaker
,GetContextMaker
- All Known Subinterfaces:
BufferedColumnRegion<ATTR>
,BufferedPage<ATTR>
,ChunkPage<ATTR>
,ColumnRegion<ATTR>
,ColumnRegionByte<ATTR>
,ColumnRegionChar<ATTR>
,ColumnRegionDouble<ATTR>
,ColumnRegionFloat<ATTR>
,ColumnRegionInt<ATTR>
,ColumnRegionLong<ATTR>
,ColumnRegionObject<T,ATTR>
,ColumnRegionReferencing<ATTR,REFERENCED_COLUMN_REGION>
,ColumnRegionShort<ATTR>
,Page<ATTR>
,Page.WithDefaults<ATTR>
,Page.WithDefaultsForRepeatingValues<ATTR>
,PageStore<ATTR,INNER_ATTR,PAGE>
,RegionedPageStore<ATTR,INNER_ATTR,REGION_TYPE>
- All Known Implementing Classes:
BooleanChunkPage
,BufferedColumnRegionBase
,BufferedColumnRegionByte
,BufferedColumnRegionChar
,BufferedColumnRegionDouble
,BufferedColumnRegionFloat
,BufferedColumnRegionInt
,BufferedColumnRegionLong
,BufferedColumnRegionShort
,BufferedPageByte
,BufferedPageChar
,BufferedPageDouble
,BufferedPageFloat
,BufferedPageInt
,BufferedPageLong
,BufferedPageShort
,ByteChunkPage
,CharChunkPage
,ColumnChunkPageStore
,ColumnRegion.Null
,ColumnRegionByte.Null
,ColumnRegionByte.StaticPageStore
,ColumnRegionChar.Null
,ColumnRegionChar.StaticPageStore
,ColumnRegionChunkDictionary
,ColumnRegionDouble.Null
,ColumnRegionDouble.StaticPageStore
,ColumnRegionFloat.Null
,ColumnRegionFloat.StaticPageStore
,ColumnRegionInt.Null
,ColumnRegionInt.StaticPageStore
,ColumnRegionLong.Null
,ColumnRegionLong.StaticPageStore
,ColumnRegionObject.DictionaryKeysWrapper
,ColumnRegionObject.IntDictionaryKeysWrapper
,ColumnRegionObject.Null
,ColumnRegionObject.StaticPageStore
,ColumnRegionObjectCached
,ColumnRegionObjectCodecFixed
,ColumnRegionObjectCodecVariable
,ColumnRegionObjectWithDictionary
,ColumnRegionReferencing.Null
,ColumnRegionReferencingImpl
,ColumnRegionShort.Null
,ColumnRegionShort.StaticPageStore
,ColumnRegionStringSet
,DeferredColumnRegionBase
,DeferredColumnRegionChar
,DeferredColumnRegionDouble
,DeferredColumnRegionFloat
,DeferredColumnRegionInt
,DeferredColumnRegionLong
,DeferredColumnRegionObject
,DeferredColumnRegionReferencing
,DeferredColumnRegionShort
,DoubleChunkPage
,FloatChunkPage
,IntChunkPage
,LongChunkPage
,ObjectChunkPage
,ParquetColumnRegionBase
,ParquetColumnRegionByte
,ParquetColumnRegionChar
,ParquetColumnRegionDouble
,ParquetColumnRegionFloat
,ParquetColumnRegionInt
,ParquetColumnRegionLong
,ParquetColumnRegionObject
,ParquetColumnRegionShort
,ParquetColumnRegionSymbolTable
,RegionedColumnSourceObject
,RegionedColumnSourceObject.AsValues
,RegionedColumnSourceObjectWithDictionary
,RegionedPageStore.Static
,ShortChunkPage
public interface PagingChunkSource<ATTR extends Attributes.Any> extends ChunkSource<ATTR>
PagingChunkSource
adds a mask to the ChunkSource, and supports some additional fillChunk
methods.
The mask is a bitmask of the lower order bits of the keys in an OrderKeys, which specifies the bits from the
OrderedKeys
which will be used to uniquely specify the offsets into the ChunkSource elements on calls to
ChunkSource.fillChunk(FillContext, WritableChunk, OrderedKeys)
,
ChunkSource.getChunk(GetContext, OrderedKeys)
, ChunkSource.getChunk(GetContext, long, long)
.
Also, a new method fillChunkAppend(FillContext, WritableChunk, OrderedKeys.Iterator)
is
added, which supports doing a fillChunk incrementally across a series of pages.-
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>
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
DEFAULT_FILL_INSTANCE, ZERO_LENGTH_CHUNK_SOURCE_ARRAY
-
Method Summary
Modifier and Type Method Description void
fillChunkAppend(ChunkSource.FillContext context, WritableChunk<? super ATTR> destination, OrderedKeys.Iterator orderedKeysIterator)
Similar toChunkSource.fillChunk(FillContext, WritableChunk, OrderedKeys)
, except that the values from the ChunkSource are appended todestination
, rather than placed at the beginning.long
mask()
This mask is applied toOrderedKeys
which are passed intoChunkSource.getChunk(ChunkSource.GetContext, OrderedKeys)
andChunkSource.fillChunk(ChunkSource.FillContext, WritableChunk, OrderedKeys)
.default long
maxRow(long row)
ThemaxRow
is the greatest possible row which may reference this ChunkSource.Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
fillChunk, getChunk, getChunk, getChunkType, getNativeType
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContext, makeFillContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContext, makeGetContext
-
Method Details
-
mask
long mask()This mask is applied toOrderedKeys
which are passed intoChunkSource.getChunk(ChunkSource.GetContext, OrderedKeys)
andChunkSource.fillChunk(ChunkSource.FillContext, WritableChunk, OrderedKeys)
. This allows thePagingChunkSource
s to be cached, and reused even if they are properly relocated in key space.- Returns:
- the mask for this page, which must be a bitmask representing the some number of lower order bits of a long.
-
maxRow
default long maxRow(long row)The
maxRow
is the greatest possible row which may reference this ChunkSource. This method is used byfillChunkAppend(FillContext, WritableChunk, OrderedKeys.Iterator)
to determine which of itsOrderedKeys
are referencing thisPagingChunkSource
.The default implementation assumes that only one
PagingChunkSource
exits for each page reference. That is, there is only onePagingChunkSource
forOrderedKey
s with the same bits outside ofmask()
.It is also possible to pack multiple, non-overlapping
PagingChunkSource
s into the same page reference. In this case, one typically will want to overridemaxRow
. An example such implementation isChunkPage
.- Parameters:
row
- Any row contained on this page.- Returns:
- the maximum last row of this page, located in the same way as row.
-
fillChunkAppend
void fillChunkAppend(@NotNull ChunkSource.FillContext context, @NotNull WritableChunk<? super ATTR> destination, @NotNull OrderedKeys.Iterator orderedKeysIterator)Similar to
ChunkSource.fillChunk(FillContext, WritableChunk, OrderedKeys)
, except that the values from the ChunkSource are appended todestination
, rather than placed at the beginning.The values to fill into
destination
are specified byorderedKeysIterator
, whoseOrderedKeys.firstKey()
must exist, and must be represented by thisPagingChunkSource
(modulo {#link @mask}), otherwise results are undefined.No more than the elements in
orderedKeysIterator
, which are on the same page asOrderedKeys.firstKey()
, have their values appended todestination
, and consumed fromorderedKeysIterator
. Keys are on the same page when the bits outside ofmask()
are identical.- Parameters:
context
- A context containing all mutable/state related data used in retrieving the Chunk. In particular, the Context may be used to provide a Chunk data pooldestination
- The chunk to append the results to.orderedKeysIterator
- The iterator to the ordered keys, which contain at least the keys to extract from thisChunkSource
. The keys to extract will be at the beginning of iteration order.
-