Interface RegionedPageStore<ATTR extends Attributes.Any,INNER_ATTR extends ATTR,REGION_TYPE extends Page<INNER_ATTR>>
- All Superinterfaces:
ChunkSource<ATTR>
,DefaultChunkSource<ATTR>
,DefaultChunkSource.SupportsContiguousGet<ATTR>
,FillContextMaker
,GetContextMaker
,LongSizedDataStructure
,PageStore<ATTR,INNER_ATTR,REGION_TYPE>
,PagingChunkSource<ATTR>
- All Known Implementing Classes:
ColumnRegionByte.StaticPageStore
,ColumnRegionChar.StaticPageStore
,ColumnRegionDouble.StaticPageStore
,ColumnRegionFloat.StaticPageStore
,ColumnRegionInt.StaticPageStore
,ColumnRegionLong.StaticPageStore
,ColumnRegionObject.StaticPageStore
,ColumnRegionShort.StaticPageStore
,RegionedColumnSourceObject
,RegionedColumnSourceObject.AsValues
,RegionedColumnSourceObjectWithDictionary
,RegionedPageStore.Static
public interface RegionedPageStore<ATTR extends Attributes.Any,INNER_ATTR extends ATTR,REGION_TYPE extends Page<INNER_ATTR>> extends PageStore<ATTR,INNER_ATTR,REGION_TYPE>, LongSizedDataStructure
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RegionedPageStore.Helper
static class
RegionedPageStore.Static<ATTR extends Attributes.Any,INNER_ATTR extends ATTR,REGION_TYPE extends Page<INNER_ATTR>>
A regioned page store for use when the full set of regions and their sizes are known.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 Modifier and Type Field Description static long
REGION_MASK
static long
REGION_MASK_NUM_BITS
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 static long
getElementIndex(int regionIndex, long regionOffset)
Get the element index.static long
getFirstElementIndex(int regionIndex)
Get the first element index.static long
getLastElementIndex(int regionIndex)
Get the last element index.default REGION_TYPE
getPageContaining(ChunkSource.FillContext fillContext, long row)
REGION_TYPE
getRegion(int regionIndex)
Map from a region index to its corresponding region.int
getRegionCount()
Get the number of regions.static int
getRegionIndex(long elementIndex)
Get the region index.default REGION_TYPE
lookupRegion(long elementIndex)
Perform region lookup for an element index.default ChunkSource.FillContext
makeFillContext(int chunkCapacity, SharedContext sharedContext)
Allocate a newChunkSource.FillContext
for filling chunks from thisFillContextMaker
, typically aChunkSource
.default long
mask()
This mask is applied toOrderedKeys
which are passed intoChunkSource.getChunk(ChunkSource.GetContext, OrderedKeys)
andChunkSource.fillChunk(ChunkSource.FillContext, WritableChunk, OrderedKeys)
.default long
size()
The size of this data structure.Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
getChunkType, getNativeType
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunkByFilling, makeGetContext
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.PageStore
doFillChunkAppend, fillChunk, fillChunkAppend, getChunk, getChunk
-
Field Details
-
REGION_MASK
static final long REGION_MASK- See Also:
- Constant Field Values
-
REGION_MASK_NUM_BITS
static final long REGION_MASK_NUM_BITS
-
-
Method Details
-
size
default long size()Description copied from interface:LongSizedDataStructure
The size of this data structure.- Specified by:
size
in interfaceLongSizedDataStructure
- Returns:
- The total number of rows across all regions.
- ImplNote:
- We intentionally do not derive from Page and implement Page.length() because our index is not contiguous.
-
getRegionIndex
static int getRegionIndex(long elementIndex)Get the region index.- Returns:
- The region index for an element index.
-
getFirstElementIndex
static long getFirstElementIndex(int regionIndex)Get the first element index.- Returns:
- the first element index for a region index.
-
getLastElementIndex
static long getLastElementIndex(int regionIndex)Get the last element index.- Returns:
- the last element index for a region index.
-
getElementIndex
static long getElementIndex(int regionIndex, long regionOffset)Get the element index.- Returns:
- the element index for a particular region offset of a region index.
-
getRegionCount
int getRegionCount()Get the number of regions.- Returns:
- The number of regions that have been added
-
getRegion
Map from a region index to its corresponding region.- Parameters:
regionIndex
- The region index- Returns:
- The region for the supplied region index
-
lookupRegion
Perform region lookup for an element index.- Parameters:
elementIndex
- The element index to get the region for- Returns:
- The appropriate region
-
getPageContaining
@NotNull @FinalDefault default REGION_TYPE getPageContaining(ChunkSource.FillContext fillContext, long row)- Specified by:
getPageContaining
in interfacePageStore<ATTR extends Attributes.Any,INNER_ATTR extends ATTR,REGION_TYPE extends Page<INNER_ATTR>>
- Returns:
- The page containing row, after applying
PagingChunkSource.mask()
.
-
mask
Description copied from interface:PagingChunkSource
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.- Specified by:
mask
in interfacePagingChunkSource<ATTR extends Attributes.Any>
- Returns:
- the mask for this page, which must be a bitmask representing the some number of lower order bits of a long.
-
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
-