Class HashedPartitionsSpec
- java.lang.Object
-
- org.apache.druid.indexer.partitions.HashedPartitionsSpec
-
- All Implemented Interfaces:
DimensionBasedPartitionsSpec,PartitionsSpec
public class HashedPartitionsSpec extends Object implements DimensionBasedPartitionsSpec
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAME-
Fields inherited from interface org.apache.druid.indexer.partitions.DimensionBasedPartitionsSpec
ASSUME_GROUPED, FORCE_GUARANTEED_ROLLUP_COMPATIBLE, MAX_PARTITION_SIZE, PARTITION_DIMENSIONS, TARGET_PARTITION_SIZE, TARGET_ROWS_PER_SEGMENT
-
Fields inherited from interface org.apache.druid.indexer.partitions.PartitionsSpec
DEFAULT_MAX_ROWS_PER_SEGMENT, HISTORICAL_NULL, MAX_ROWS_PER_SEGMENT
-
-
Constructor Summary
Constructors Constructor Description HashedPartitionsSpec(Integer maxRowsPerSegment, Integer numShards, List<String> partitionDimensions)HashedPartitionsSpec(Integer maxRowsPerSegment, Integer numShards, List<String> partitionDimensions, HashPartitionFunction partitionFunction)HashedPartitionsSpec(Integer targetRowsPerSegment, Integer numShards, List<String> partitionDimensions, HashPartitionFunction partitionFunction, Integer targetPartitionSize, Integer maxRowsPerSegment)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HashedPartitionsSpecdefaultSpec()booleanequals(Object o)StringgetForceGuaranteedRollupIncompatiblityReason()IntegergetMaxRowsPerSegment()Returns the max number of rows per segment.IntegergetNumShards()List<String>getPartitionDimensions()HashPartitionFunctiongetPartitionFunction()IntegergetTargetRowsPerSegment()SecondaryPartitionTypegetType()inthashCode()booleanneedsDeterminePartitions(boolean useForHadoopTask)Returns true if this partitionsSpec needs to determine the number of partitions to start data ingestion.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.druid.indexer.partitions.PartitionsSpec
isForceGuaranteedRollupCompatible, isForceGuaranteedRollupCompatibleType
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HashedPartitionsSpec
public HashedPartitionsSpec(@Nullable Integer targetRowsPerSegment, @Nullable Integer numShards, @Nullable List<String> partitionDimensions, @Nullable HashPartitionFunction partitionFunction, @Deprecated @Nullable Integer targetPartitionSize, @Deprecated @Nullable Integer maxRowsPerSegment)
-
HashedPartitionsSpec
public HashedPartitionsSpec(@Nullable Integer maxRowsPerSegment, @Nullable Integer numShards, @Nullable List<String> partitionDimensions, @Nullable HashPartitionFunction partitionFunction)
-
-
Method Detail
-
defaultSpec
public static HashedPartitionsSpec defaultSpec()
-
getTargetRowsPerSegment
@Nullable public Integer getTargetRowsPerSegment()
- Specified by:
getTargetRowsPerSegmentin interfaceDimensionBasedPartitionsSpec
-
getType
public SecondaryPartitionType getType()
- Specified by:
getTypein interfacePartitionsSpec
-
getMaxRowsPerSegment
@Nullable public Integer getMaxRowsPerSegment()
Description copied from interface:PartitionsSpecReturns the max number of rows per segment. Implementations can have different default values which it could be even null. Callers should use the right value depending on the context if this returns null.- Specified by:
getMaxRowsPerSegmentin interfacePartitionsSpec
-
needsDeterminePartitions
public boolean needsDeterminePartitions(boolean useForHadoopTask)
Description copied from interface:PartitionsSpecReturns true if this partitionsSpec needs to determine the number of partitions to start data ingestion. It should usually return true if perfect rollup is enforced but number of partitions is not specified.- Specified by:
needsDeterminePartitionsin interfacePartitionsSpec
-
getPartitionDimensions
public List<String> getPartitionDimensions()
- Specified by:
getPartitionDimensionsin interfaceDimensionBasedPartitionsSpec
-
getPartitionFunction
public HashPartitionFunction getPartitionFunction()
-
getForceGuaranteedRollupIncompatiblityReason
public String getForceGuaranteedRollupIncompatiblityReason()
- Specified by:
getForceGuaranteedRollupIncompatiblityReasonin interfacePartitionsSpec- Returns:
- Message describing why this partitionSpec is incompatible with forceGuaranteedRollup=true. Empty string if the partitionSpec is compatible.
-
-