Class NumberedShardSpec
java.lang.Object
org.apache.druid.timeline.partition.NumberedShardSpec
- All Implemented Interfaces:
ShardSpec
- Direct Known Subclasses:
HashBasedNumberedShardSpec
An extendable linear shard spec containing the information of core partitions. This class contains two variables of
partitionNum and partitions, which represent the unique id of a partition and the number of core
partitions, respectively. partitions simply indicates that the atomic update is regarded as completed when
partitions partitions are successfully updated, and partitionNum can go beyond it when some types
of index tasks are trying to append to existing partitions.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.timeline.partition.ShardSpec
ShardSpec.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whetherShardSpec.createChunk(T)returns aNumberedPartitionChunkinstance.<T> PartitionChunk<T>createChunk(T obj) booleanGet dimensions who have possible range for the rows this shard contains.intintReturns the partition ID of this segment.getType()Get the type name of this ShardSpec.inthashCode()booleanpossibleInDomain(Map<String, com.google.common.collect.RangeSet<String>> domain) if given domain ranges are not possible in this shard, return false; otherwise return true;toString()withCorePartitions(int partitions) Creates a new ShardSpec with the specified number of core partitions.withPartitionNum(int partitionNum) Creates a new ShardSpec with the specified partition number.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.druid.timeline.partition.ShardSpec
getAtomicUpdateGroupSize, getDomainVirtualColumns, getEndRootPartitionId, getMinorVersion, getStartRootPartitionId, sharePartitionSpace
-
Constructor Details
-
NumberedShardSpec
public NumberedShardSpec(int partitionNum, int partitions)
-
-
Method Details
-
getPartitionNum
public int getPartitionNum()Description copied from interface:ShardSpecReturns the partition ID of this segment.- Specified by:
getPartitionNumin interfaceShardSpec
-
getLookup
-
getDomainDimensions
Description copied from interface:ShardSpecGet 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 inShardSpec.getDomainVirtualColumns().- Specified by:
getDomainDimensionsin interfaceShardSpec- Returns:
- list of dimensions who has its possible range. Dimensions with unknown possible range are not listed.
-
possibleInDomain
Description copied from interface:ShardSpecif given domain ranges are not possible in this shard, return false; otherwise return true;- Specified by:
possibleInDomainin interfaceShardSpec- Returns:
- possibility of in domain
-
getNumCorePartitions
public int getNumCorePartitions()- Specified by:
getNumCorePartitionsin interfaceShardSpec
-
withPartitionNum
Description copied from interface:ShardSpecCreates a new ShardSpec with the specified partition number.- Specified by:
withPartitionNumin interfaceShardSpec
-
withCorePartitions
Description copied from interface:ShardSpecCreates a new ShardSpec with the specified number of core partitions.- Specified by:
withCorePartitionsin interfaceShardSpec
-
canCreateNumberedPartitionChunk
public boolean canCreateNumberedPartitionChunk()Description copied from interface:ShardSpecReturns whetherShardSpec.createChunk(T)returns aNumberedPartitionChunkinstance. This is necessary for supportingPartitionHolder.isComplete()if updating to a new corePartitions spec.- Specified by:
canCreateNumberedPartitionChunkin interfaceShardSpec
-
createChunk
- Specified by:
createChunkin interfaceShardSpec
-
getType
Description copied from interface:ShardSpecGet the type name of this ShardSpec. -
toString
-
equals
-
hashCode
public int hashCode()
-