Class HashBasedNumberedPartialShardSpec
- java.lang.Object
-
- org.apache.druid.timeline.partition.HashBasedNumberedPartialShardSpec
-
- All Implemented Interfaces:
PartialShardSpec
public class HashBasedNumberedPartialShardSpec extends Object implements PartialShardSpec
-
-
Constructor Summary
Constructors Constructor Description HashBasedNumberedPartialShardSpec(List<String> partitionDimensions, int bucketId, int numBuckets, HashPartitionFunction partitionFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ShardSpeccomplete(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int partitionId, int numCorePartitions)Creates a new ShardSpec with given partitionId and numCorePartitions.booleanequals(Object o)intgetBucketId()intgetNumBuckets()List<String>getPartitionDimensions()HashPartitionFunctiongetPartitionFunction()Class<? extends ShardSpec>getShardSpecClass()Returns the class of the shardSpec created by this factory.inthashCode()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.timeline.partition.PartialShardSpec
useNonRootGenerationPartitionSpace
-
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HashBasedNumberedPartialShardSpec
public HashBasedNumberedPartialShardSpec(@Nullable List<String> partitionDimensions, int bucketId, int numBuckets, @Nullable HashPartitionFunction partitionFunction)
-
-
Method Detail
-
getBucketId
public int getBucketId()
-
getNumBuckets
public int getNumBuckets()
-
getPartitionFunction
@Nullable public HashPartitionFunction getPartitionFunction()
-
complete
public ShardSpec complete(com.fasterxml.jackson.databind.ObjectMapper objectMapper, int partitionId, int numCorePartitions)
Description copied from interface:PartialShardSpecCreates a new ShardSpec with given partitionId and numCorePartitions.- Specified by:
completein interfacePartialShardSpec- Parameters:
objectMapper- jsonMapper used only forHashBasedNumberedShardSpecpartitionId- partitionId of the shardSpec. must be carefully chosen to be unique in a time chunknumCorePartitions- the core partition set size. Should be set properly to determine if this segment belongs to the core partitions.
-
getShardSpecClass
public Class<? extends ShardSpec> getShardSpecClass()
Description copied from interface:PartialShardSpecReturns the class of the shardSpec created by this factory.- Specified by:
getShardSpecClassin interfacePartialShardSpec
-
-