Class LinearShardSpec

java.lang.Object
org.apache.druid.timeline.partition.LinearShardSpec
All Implemented Interfaces:
ShardSpec

public final class LinearShardSpec extends Object implements ShardSpec
An extendable linear shard spec. partitionNum represents an unique id of a partition.
  • Constructor Details

    • LinearShardSpec

      public LinearShardSpec(Integer partitionNum)
  • Method Details

    • getPartitionNum

      public int getPartitionNum()
      Description copied from interface: ShardSpec
      Returns the partition ID of this segment.
      Specified by:
      getPartitionNum in interface ShardSpec
    • getNumCorePartitions

      public int getNumCorePartitions()
      Specified by:
      getNumCorePartitions in interface ShardSpec
    • withPartitionNum

      public ShardSpec withPartitionNum(int partitionNum)
      Description copied from interface: ShardSpec
      Creates a new ShardSpec with the specified partition number.
      Specified by:
      withPartitionNum in interface ShardSpec
    • withCorePartitions

      public ShardSpec withCorePartitions(int partitions)
      Description copied from interface: ShardSpec
      Creates a new ShardSpec with the specified number of core partitions.
      Specified by:
      withCorePartitions in interface ShardSpec
    • getLookup

      public ShardSpecLookup getLookup(List<? extends ShardSpec> shardSpecs)
      Specified by:
      getLookup in interface ShardSpec
    • getDomainDimensions

      public List<String> getDomainDimensions()
      Description copied from interface: ShardSpec
      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 ShardSpec.getDomainVirtualColumns().
      Specified by:
      getDomainDimensions in interface ShardSpec
      Returns:
      list of dimensions who has its possible range. Dimensions with unknown possible range are not listed.
    • possibleInDomain

      public boolean possibleInDomain(Map<String,com.google.common.collect.RangeSet<String>> domain)
      Description copied from interface: ShardSpec
      if given domain ranges are not possible in this shard, return false; otherwise return true;
      Specified by:
      possibleInDomain in interface ShardSpec
      Returns:
      possibility of in domain
    • createChunk

      public <T> PartitionChunk<T> createChunk(T obj)
      Specified by:
      createChunk in interface ShardSpec
    • getType

      public String getType()
      Description copied from interface: ShardSpec
      Get the type name of this ShardSpec.
      Specified by:
      getType in interface ShardSpec
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object