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" SourceTables can be thought of a tree of partitions with
TableLocations 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 longThe mask for converting from an element index to a region sub-index.static final intThe maximum number of regions that may be addressed.static final longThe size used for *all* regions.static final intAddress bits allocated to the region index.static final intAddress 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_ARRAYFields inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
ZERO_LENGTH_CHUNK_SOURCE_WITH_PREV_ARRAYFields inherited from interface com.illumon.iris.db.v2.sources.ColumnSource
ZERO_LENGTH_COLUMN_SOURCE_ARRAY -
Method Summary
Modifier and TypeMethodDescriptionintaddRegion(com.illumon.dataobjects.ColumnDefinition<?> columnDefinition, ColumnLocation columnLocation, SourceTableColumnInstructions instructions) Add a region to this regioned column source.voidDisable the use of grouping for any operation of this source.Methods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource
fillChunk, getChunkTypeMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.ChunkSource.WithPrev
fillPrevChunkMethods 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, startTrackingPrevValuesMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource
getChunk, getChunk, getChunkByFilling, makeFillContext, makeGetContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.DefaultChunkSource.WithPrev
getPrevChunk, getPrevChunk, getPrevChunkByFillingMethods inherited from interface com.illumon.iris.db.v2.sources.ElementSource
get, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getShortMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.FillContextMaker
makeFillContextMethods inherited from interface com.illumon.iris.db.v2.sources.chunk.GetContextMaker
makeGetContextMethods inherited from interface com.illumon.iris.db.v2.sources.ImmutableColumnSource
getPrev, getPrevBoolean, getPrevByte, getPrevChar, getPrevDouble, getPrevFloat, getPrevInt, getPrevLong, getPrevShort, isImmutableMethods inherited from interface com.illumon.iris.db.util.LongSizedDataStructure
intSize, intSize, sizeMethods inherited from interface com.illumon.iris.db.v2.tuples.TupleExporter
exportElementReinterpretedMethods 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.
-