Interface RegionedColumnSource<DATA_TYPE>
- All Superinterfaces:
ChunkSource<Attributes.Values>
,ChunkSource.WithPrev<Attributes.Values>
,ColumnSource<DATA_TYPE>
,DefaultChunkSource<Attributes.Values>
,DefaultChunkSource.WithPrev<Attributes.Values>
,ElementSource<DATA_TYPE>
,FillContextMaker
,GetContextMaker
,ImmutableColumnSource<DATA_TYPE>
,LongSizedDataStructure
,Releasable
,SizedColumnSource<DATA_TYPE>
,TupleExporter<DATA_TYPE>
,TupleSource<DATA_TYPE>
- All Known Subinterfaces:
PartitioningRegionedSource
- All Known Implementing Classes:
RegionedColumnSourceBase
,RegionedColumnSourceObject
,RegionedColumnSourceObject.AsValues
,RegionedColumnSourceObjectWithDictionary
,RegionedColumnSourcePartitioning
Regioned column source interface.
"V2" SourceTable
s can be thought of a tree of partitions with
TableLocation
s at the leaf nodes. When building the
Index
for such a Table
, we statically
partition the available element address space from [0, 9223372036854775807L (2^63-1)].
We constrain the size at these leaf nodes in order to support a partitioning of the element address space into region index and sub-region element index. In order to make the calculations as inexpensive as possible, this is done by assigning X bits of each index key (element address) to the region index, and the remaining Y = 63 - X to the sub-region element index.
This type of address space allocation allows very cheap O(1) element access. Denser alternatives tend to introduce more complication and/or O(log n) lookups.
Currently, X is 23 and Y is 40, allowing tables to consist of more than 8 million locations with more than 1 trillion elements each.
-
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
FieldsModifier and TypeFieldDescriptionstatic final long
The mask for converting from an element index to a region sub-index.static final int
The maximum number of regions that may be addressed.static final long
The size used for *all* regions.static final int
Address bits allocated to the region index.static final int
Address bits allocated to the sub-region element index.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
Fields inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY
-
Method Summary
Modifier and TypeMethodDescriptionint
addRegion
(com.illumon.dataobjects.ColumnDefinition<?> columnDefinition, ColumnLocation columnLocation, SourceTableColumnInstructions instructions) Add a region to this regioned column source.void
Disable the use of grouping for any operation of this source.Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
fillChunk, getChunkType
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
fillPrevChunk
Methods inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
allowsReinterpret, cast, createPreviousTuple, createTuple, createTupleFromValues, exportElement, exportElement, exportToExternalKey, getColumnSources, getComponentType, getGroupingBuilder, getGroupingProvider, getNativeType, getPrevSource, getType, hasGrouping, hasGrouping, match, reinterpret, releaseCachedResources, setGroupingProvider, startTrackingPrevValues
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContext
Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFilling
Methods inherited from interface com.illumon.iris.db.v2.sources.ElementSource
get, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShort
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.ImmutableColumnSource
getPrev, getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort, isImmutable
Methods inherited from interface com.illumon.iris.db.util.LongSizedDataStructure
intSize, intSize, size
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpreted
Methods inherited from interface com.illumon.iris.db.v2.tuples.TupleSource
createTupleFromReinterpretedValues
-
Field Details
-
REGION_INDEX_ADDRESS_BITS
static final int REGION_INDEX_ADDRESS_BITSAddress bits allocated to the region index.- See Also:
-
SUB_REGION_ELEMENT_INDEX_ADDRESS_BITS
static final int SUB_REGION_ELEMENT_INDEX_ADDRESS_BITSAddress bits allocated to the sub-region element index.- See Also:
-
MAXIMUM_REGION_COUNT
static final int MAXIMUM_REGION_COUNTThe maximum number of regions that may be addressed.- See Also:
-
REGION_CAPACITY_IN_ELEMENTS
static final long REGION_CAPACITY_IN_ELEMENTSThe size used for *all* regions.- See Also:
-
ELEMENT_INDEX_TO_SUB_REGION_ELEMENT_INDEX_MASK
static final long ELEMENT_INDEX_TO_SUB_REGION_ELEMENT_INDEX_MASKThe mask for converting from an element index to a region sub-index.- See Also:
-
-
Method Details
-
addRegion
int addRegion(@NotNull com.illumon.dataobjects.ColumnDefinition<?> columnDefinition, @NotNull ColumnLocation columnLocation, @NotNull SourceTableColumnInstructions instructions) Add a region to this regioned column source. Elements in this region are ordered after elements in other regions added previously.- Parameters:
columnDefinition
- The column definition for this column source (potentially varies by region)columnLocation
- The column location for the region being added- Returns:
- The index assigned to the added region
-
disableGrouping
void disableGrouping()Disable the use of grouping for any operation of this source.
-