Interface ChunkPage<ATTR extends Attributes.Any>
- All Superinterfaces:
Chunk<ATTR>
,ChunkSource<ATTR>
,DefaultChunkSource<ATTR>
,DefaultChunkSource.SupportsContiguousGet<ATTR>
,FillContextMaker
,GetContextMaker
,Page<ATTR>
,Page.WithDefaults<ATTR>
,PagingChunkSource<ATTR>
- All Known Implementing Classes:
BooleanChunkPage
,ByteChunkPage
,CharChunkPage
,DoubleChunkPage
,FloatChunkPage
,IntChunkPage
,LongChunkPage
,ObjectChunkPage
,ShortChunkPage
public interface ChunkPage<ATTR extends Attributes.Any> extends Page.WithDefaults<ATTR>, Chunk<ATTR>, DefaultChunkSource.SupportsContiguousGet<ATTR>
-
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>
Nested classes/interfaces inherited from interface com.illumon.iris.db.v2.sources.chunk.page.Page
Page.WithDefaults<ATTR extends Attributes.Any>, Page.WithDefaultsForRepeatingValues<ATTR extends Attributes.Any>
-
Field Summary
Fields inherited from interface com.illumon.iris.db.v2.sources.chunk.Chunk
MAXIMUM_SIZE, SYSTEM_ARRAYCOPY_THRESHOLD, SYSTEM_ARRAYFILL_THRESHOLD
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 default Chunk<? extends ATTR>
getChunk(ChunkSource.GetContext context, long firstKey, long lastKey)
Same asChunkSource.getChunk(GetContext, OrderedKeys)
, except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anOrderedKeys
.default int
getChunkOffset(long row)
ChunkType
getChunkType()
Get the most suitableChunkType
for use with this ColumnSource.default long
length()
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.Chunk
asBooleanChunk, asByteChunk, asCharChunk, asDoubleChunk, asFloatChunk, asIntChunk, asLongChunk, asObjectChunk, asShortChunk, copyToArray, copyToBuffer, copyToChunk, isAlias, isAlias, size, slice
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunkByFilling, makeFillContext, makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.SupportsContiguousGet
getChunk
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
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.page.Page
advanceToNextPage, advanceToNextPage, advanceToNextPageAndGetPositionDistance, firstRow, firstRowOffset, getRowOffset, lastRow
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.page.Page.WithDefaults
fillChunk, fillChunkAppend, fillChunkAppend
-
Method Details
-
getChunkType
ChunkType getChunkType()Description copied from interface:ChunkSource
Get the most suitableChunkType
for use with this ColumnSource.- Specified by:
getChunkType
in interfaceChunk<ATTR extends Attributes.Any>
- Specified by:
getChunkType
in interfaceChunkSource<ATTR extends Attributes.Any>
- Returns:
- The ChunkType
-
length
- Specified by:
length
in interfacePage<ATTR extends Attributes.Any>
- Returns:
- the length of this page.
-
maxRow
Description copied from interface:PagingChunkSource
The
maxRow
is the greatest possible row which may reference this ChunkSource. This method is used byPagingChunkSource.fillChunkAppend(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 ofPagingChunkSource.mask()
.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
.- Specified by:
maxRow
in interfacePagingChunkSource<ATTR extends Attributes.Any>
- Parameters:
row
- Any row contained on this page.- Returns:
- the maximum last row of this page, located in the same way as row.
-
getChunkOffset
- Returns:
- The offset into the chunk for this row.
- ApiNote:
- This function is for convenience over
Page.getRowOffset(long)
, so the caller doesn't have to cast to an int. - ImplNote:
- This page is known to be a chunk, so
Chunk.size()
is an int, and so is the offset.
-
getChunk
@FinalDefault default Chunk<? extends ATTR> getChunk(@NotNull ChunkSource.GetContext context, long firstKey, long lastKey)Description copied from interface:ChunkSource
Same asChunkSource.getChunk(GetContext, OrderedKeys)
, except that you pass in the begin and last keys representing the begin and last (inclusive) keys of a single range rather than anOrderedKeys
. Typically you want to call this only if you don't have anOrderedKeys
, such as during anOrderedKeys.forAllLongRanges(LongRangeConsumer)
call. In this case, it allows you to avoid creating an intermediaryOrderedKeys
object.- Specified by:
getChunk
in interfaceChunkSource<ATTR extends Attributes.Any>
- Specified by:
getChunk
in interfaceDefaultChunkSource<ATTR extends Attributes.Any>
- Specified by:
getChunk
in interfaceDefaultChunkSource.SupportsContiguousGet<ATTR extends Attributes.Any>
- 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 poolfirstKey
- The beginning key (inclusive) of the range to fetch in the chunklastKey
- The last key (inclusive) of the range to fetch in the chunk- Returns:
- A chunk of data corresponding to the keys from the given range.
-