Interface ShardSpec

All Known Subinterfaces:
BucketNumberedShardSpec<T>, BuildingShardSpec<T>, OverwriteShardSpec
All Known Implementing Classes:
BaseDimensionRangeShardSpec, BuildingDimensionRangeShardSpec, BuildingHashBasedNumberedShardSpec, BuildingNumberedShardSpec, BuildingSingleDimensionShardSpec, DimensionRangeBucketShardSpec, DimensionRangeShardSpec, HashBasedNumberedShardSpec, HashBucketShardSpec, LinearShardSpec, NoneShardSpec, NumberedOverwriteShardSpec, NumberedShardSpec, SingleDimensionRangeBucketShardSpec, SingleDimensionShardSpec, TombstoneShardSpec

public interface ShardSpec
A Marker interface that exists to combine ShardSpec objects together for Jackson. Note that this is not an extension API. Extensions are not expected to create new kinds of ShardSpecs.
  • Method Details

    • canCreateNumberedPartitionChunk

      default boolean canCreateNumberedPartitionChunk()
      Returns whether createChunk(T) returns a NumberedPartitionChunk instance. This is necessary for supporting PartitionHolder.isComplete() if updating to a new corePartitions spec.
    • createChunk

      <T> PartitionChunk<T> createChunk(T obj)
    • getPartitionNum

      int getPartitionNum()
      Returns the partition ID of this segment.
    • getNumCorePartitions

      int getNumCorePartitions()
    • withPartitionNum

      default ShardSpec withPartitionNum(int partitionNum)
      Creates a new ShardSpec with the specified partition number.
    • withCorePartitions

      default ShardSpec withCorePartitions(int partitions)
      Creates a new ShardSpec with the specified number of core partitions.
    • getStartRootPartitionId

      default int getStartRootPartitionId()
      Returns the start root partition ID of the atomic update group which this segment belongs to.
      See Also:
      • AtomicUpdateGroup
    • getEndRootPartitionId

      default int getEndRootPartitionId()
      Returns the end root partition ID of the atomic update group which this segment belongs to.
      See Also:
      • AtomicUpdateGroup
    • getMinorVersion

      default short getMinorVersion()
      Returns the minor version associated to the atomic update group which this segment belongs to.
      See Also:
      • AtomicUpdateGroup
    • getAtomicUpdateGroupSize

      default short getAtomicUpdateGroupSize()
      Returns the atomic update group size which this segment belongs to.
      See Also:
      • AtomicUpdateGroup
    • getLookup

      ShardSpecLookup getLookup(List<? extends ShardSpec> shardSpecs)
    • getDomainDimensions

      List<String> getDomainDimensions()
      Get dimensions who have possible range for the rows this shard contains. These columns might be physical columns stored in the shard, or computed expressions, in which case the manner in which they were computed is available in getDomainVirtualColumns().
      Returns:
      list of dimensions who has its possible range. Dimensions with unknown possible range are not listed.
    • getDomainVirtualColumns

      default VirtualColumns getDomainVirtualColumns()
      If any of the columns in getDomainDimensions() was computed with an expression and was not stored, the VirtualColumn which computes it is stored here. This allows matching ranges even when the value is not stored in the shard so long as VirtualColumns.findEquivalent(VirtualColumns, VirtualColumn) exists.
      Returns:
      VirtualColumns associated with columns listed in getDomainDimensions().
    • possibleInDomain

      boolean possibleInDomain(Map<String,com.google.common.collect.RangeSet<String>> domain)
      if given domain ranges are not possible in this shard, return false; otherwise return true;
      Returns:
      possibility of in domain
    • getType

      default String getType()
      Get the type name of this ShardSpec.
    • sharePartitionSpace

      default boolean sharePartitionSpace(PartialShardSpec partialShardSpec)
      Returns true if this shardSpec and the given PartialShardSpec share the same partition space. All shardSpecs except OverwriteShardSpec use the root-generation partition space and thus share the same space.
      See Also: