Class AbstractReindexingRule
- All Implemented Interfaces:
ReindexingRule
- Direct Known Subclasses:
ReindexingDataSchemaRule,ReindexingDeletionRule,ReindexingIndexSpecRule,ReindexingPartitioningRule
Provides period-based applicability logic: a rule with olderThan of P7D applies to
data older than 7 days as compared to the time of evaluation. Subclasses define specific reindexing configuration
(granularity, filters, tuning, etc.) and whether multiple rules can combine (additive vs non-additive).
The appliesTo(Interval, DateTime) method determines if an interval is fully,
partially, or not covered by this rule's threshold, enabling cascading reindexing
strategies where different rules apply to different age tiers of data.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.druid.server.compaction.ReindexingRule
ReindexingRule.AppliesToMode -
Constructor Summary
ConstructorsConstructorDescriptionAbstractReindexingRule(String id, String description, org.joda.time.Period olderThan) -
Method Summary
Modifier and TypeMethodDescriptionappliesTo(org.joda.time.Interval interval, org.joda.time.DateTime referenceTime) Check if this rule applies to the given interval.Provides a human-readable description of the rule, which can be used for logging, debugging, or user interfaces to explain the purpose and behavior of the rule.getId()Provides an identifier for the rule, which can be used for referencing, logging, or management purposes.org.joda.time.PeriodDefines the age threshold for rule applicability.
-
Constructor Details
-
AbstractReindexingRule
-
-
Method Details
-
getId
Description copied from interface:ReindexingRuleProvides an identifier for the rule, which can be used for referencing, logging, or management purposes.Note that there is no inherent contract for uniqueness across rule sets provided by this interface.
- Specified by:
getIdin interfaceReindexingRule
-
getDescription
Description copied from interface:ReindexingRuleProvides a human-readable description of the rule, which can be used for logging, debugging, or user interfaces to explain the purpose and behavior of the rule.- Specified by:
getDescriptionin interfaceReindexingRule
-
getOlderThan
public org.joda.time.Period getOlderThan()Description copied from interface:ReindexingRuleDefines the age threshold for rule applicability. The rule applies to data older than a reference time minus this period.For example, if the period is "P30D" (30 days) and the reference time is "2024-01-31T00:00:00Z", the rule applies to data older than "2024-01-01T00:00:00Z".
- Specified by:
getOlderThanin interfaceReindexingRule- Returns:
- The period representing the age threshold for rule applicability.
-
appliesTo
public ReindexingRule.AppliesToMode appliesTo(org.joda.time.Interval interval, @Nullable org.joda.time.DateTime referenceTime) Description copied from interface:ReindexingRuleCheck if this rule applies to the given interval.- If the rule applies to the entire interval, return
ReindexingRule.AppliesToMode.FULL. - If the rule applies to only part of the interval, return
ReindexingRule.AppliesToMode.PARTIAL. - If the rule does not apply to the interval at all, return
ReindexingRule.AppliesToMode.NONE.
- Specified by:
appliesToin interfaceReindexingRule- Parameters:
interval- The interval to check applicability against.referenceTime- The reference time to use for period calculations. null results in using current UTC instant at runtime.- Returns:
- The applicability mode of the rule for the given interval and reference time.
- If the rule applies to the entire interval, return
-