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

public interface RegionedColumnSource<DATA_TYPE> extends ImmutableColumnSource<DATA_TYPE>, SizedColumnSource<DATA_TYPE>

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.

  • Field Details

    • REGION_INDEX_ADDRESS_BITS

      static final int REGION_INDEX_ADDRESS_BITS
      Address bits allocated to the region index.
      See Also:
    • SUB_REGION_ELEMENT_INDEX_ADDRESS_BITS

      static final int SUB_REGION_ELEMENT_INDEX_ADDRESS_BITS
      Address bits allocated to the sub-region element index.
      See Also:
    • MAXIMUM_REGION_COUNT

      static final int MAXIMUM_REGION_COUNT
      The maximum number of regions that may be addressed.
      See Also:
    • REGION_CAPACITY_IN_ELEMENTS

      static final long REGION_CAPACITY_IN_ELEMENTS
      The 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_MASK
      The 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.