Class HashBasedNumberedShardSpec
java.lang.Object
org.apache.druid.timeline.partition.NumberedShardSpec
org.apache.druid.timeline.partition.HashBasedNumberedShardSpec
- All Implemented Interfaces:
ShardSpec
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.timeline.partition.ShardSpec
ShardSpec.Type -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHashBasedNumberedShardSpec(int partitionNum, int partitions, Integer bucketId, Integer numBuckets, List<String> partitionDimensions, HashPartitionFunction partitionFunction, com.fasterxml.jackson.databind.ObjectMapper jsonMapper) -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGet dimensions who have possible range for the rows this shard contains.intgetType()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;static byte[]serializeGroupKey(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, List<Object> partitionKeys) Serializes a group key into a byte array.toString()Methods inherited from class org.apache.druid.timeline.partition.NumberedShardSpec
canCreateNumberedPartitionChunk, createChunk, getNumCorePartitions, getPartitionNum, withCorePartitions, withPartitionNumMethods 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
-
Field Details
-
DEFAULT_PARTITION_DIMENSIONS
-
-
Constructor Details
-
HashBasedNumberedShardSpec
public HashBasedNumberedShardSpec(int partitionNum, int partitions, @Nullable Integer bucketId, @Nullable Integer numBuckets, @Nullable List<String> partitionDimensions, @Nullable HashPartitionFunction partitionFunction, com.fasterxml.jackson.databind.ObjectMapper jsonMapper)
-
-
Method Details
-
getBucketId
public int getBucketId() -
getNumBuckets
public int getNumBuckets() -
getPartitionDimensions
-
getPartitionFunction
-
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- Overrides:
getDomainDimensionsin classNumberedShardSpec- Returns:
- list of dimensions who has its possible range. Dimensions with unknown possible range are not listed.
-
getLookup
- Specified by:
getLookupin interfaceShardSpec- Overrides:
getLookupin classNumberedShardSpec
-
possibleInDomain
Description copied from interface:ShardSpecif given domain ranges are not possible in this shard, return false; otherwise return true;- Specified by:
possibleInDomainin interfaceShardSpec- Overrides:
possibleInDomainin classNumberedShardSpec- Returns:
- possibility of in domain
-
serializeGroupKey
public static byte[] serializeGroupKey(com.fasterxml.jackson.databind.ObjectMapper jsonMapper, List<Object> partitionKeys) Serializes a group key into a byte array. The serialization algorithm can affect hash values of partition keys sinceHashPartitionFunction.hash(byte[], int)takes the result of this method as its input. This means, the returned byte array should be backwards-compatible in cases where we need to modify this method. -
getType
Description copied from interface:ShardSpecGet the type name of this ShardSpec.- Specified by:
getTypein interfaceShardSpec- Overrides:
getTypein classNumberedShardSpec
-
equals
- Overrides:
equalsin classNumberedShardSpec
-
hashCode
public int hashCode()- Overrides:
hashCodein classNumberedShardSpec
-
toString
- Overrides:
toStringin classNumberedShardSpec
-