Class DimensionRangePartitionsSpec
- java.lang.Object
-
- org.apache.druid.indexer.partitions.DimensionRangePartitionsSpec
-
- All Implemented Interfaces:
DimensionBasedPartitionsSpec
,PartitionsSpec
- Direct Known Subclasses:
SingleDimensionPartitionsSpec
public class DimensionRangePartitionsSpec extends Object implements DimensionBasedPartitionsSpec
Spec to create partitions based on value ranges of multiple dimensions.A MultiDimensionPartitionSpec has the following fields:
- either targetRowsPerSegment or maxRowsPerSegment
- partitionDimensions: List of dimension names to be used for partitioning
- assumeGrouped: true if input data has already been grouped on time and dimensions
-
-
Field Summary
Fields Modifier and Type Field Description static String
NAME
-
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 DimensionRangePartitionsSpec(Integer targetRowsPerSegment, Integer maxRowsPerSegment, List<String> partitionDimensions, boolean assumeGrouped)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getForceGuaranteedRollupIncompatiblityReason()
@NotNull Integer
getMaxRowsPerSegment()
Returns the max number of rows per segment.protected Integer
getMaxRowsPerSegmentForJson()
List<String>
getPartitionDimensions()
Integer
getTargetRowsPerSegment()
SecondaryPartitionType
getType()
int
hashCode()
boolean
isAssumeGrouped()
boolean
needsDeterminePartitions(boolean useForHadoopTask)
Returns true if this partitionsSpec needs to determine the number of partitions to start data ingestion.String
toString()
-
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
-
-
Method Detail
-
getTargetRowsPerSegment
@Nullable public Integer getTargetRowsPerSegment()
- Specified by:
getTargetRowsPerSegment
in interfaceDimensionBasedPartitionsSpec
-
getType
public SecondaryPartitionType getType()
- Specified by:
getType
in interfacePartitionsSpec
-
getMaxRowsPerSegment
@NotNull public @NotNull Integer getMaxRowsPerSegment()
Description copied from interface:PartitionsSpec
Returns 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:
getMaxRowsPerSegment
in interfacePartitionsSpec
- Returns:
- Resolved value of max rows per segment.
-
getMaxRowsPerSegmentForJson
protected Integer getMaxRowsPerSegmentForJson()
-
isAssumeGrouped
public boolean isAssumeGrouped()
-
getPartitionDimensions
public List<String> getPartitionDimensions()
- Specified by:
getPartitionDimensions
in interfaceDimensionBasedPartitionsSpec
-
getForceGuaranteedRollupIncompatiblityReason
public String getForceGuaranteedRollupIncompatiblityReason()
- Specified by:
getForceGuaranteedRollupIncompatiblityReason
in interfacePartitionsSpec
- Returns:
- Message describing why this partitionSpec is incompatible with forceGuaranteedRollup=true. Empty string if the partitionSpec is compatible.
-
needsDeterminePartitions
public boolean needsDeterminePartitions(boolean useForHadoopTask)
Description copied from interface:PartitionsSpec
Returns 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:
needsDeterminePartitions
in interfacePartitionsSpec
-
-