Class FixedIntervalOrderPolicy
java.lang.Object
org.apache.druid.server.compaction.FixedIntervalOrderPolicy
- All Implemented Interfaces:
CompactionCandidateSearchPolicy
Implementation of
CompactionCandidateSearchPolicy that specifies the
datasources and intervals eligible for compaction and their order.
This policy is primarily used for integration tests.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSpecifies a datasource-interval eligible for compaction. -
Constructor Summary
ConstructorsConstructorDescriptionFixedIntervalOrderPolicy(List<FixedIntervalOrderPolicy.Candidate> eligibleCandidates) -
Method Summary
Modifier and TypeMethodDescriptionintcompareCandidates(CompactionCandidate candidateA, CompactionCandidate candidateB) Compares between two compaction candidates.booleanisEligibleForCompaction(CompactionCandidate candidate, CompactionStatus currentCompactionStatus, CompactionTaskStatus latestTaskStatus) Checks if the givenCompactionCandidateis eligible for compaction in the current iteration.
-
Constructor Details
-
FixedIntervalOrderPolicy
-
-
Method Details
-
getEligibleCandidates
-
compareCandidates
Description copied from interface:CompactionCandidateSearchPolicyCompares between two compaction candidates. Used to determine the order in which segments and intervals should be picked for compaction.- Specified by:
compareCandidatesin interfaceCompactionCandidateSearchPolicy- Returns:
- A positive value if
candidateAshould be picked first, a negative value ifcandidateBshould be picked first or zero if the order does not matter.
-
isEligibleForCompaction
public boolean isEligibleForCompaction(CompactionCandidate candidate, CompactionStatus currentCompactionStatus, CompactionTaskStatus latestTaskStatus) Description copied from interface:CompactionCandidateSearchPolicyChecks if the givenCompactionCandidateis eligible for compaction in the current iteration. A policy may implement this method to skip compacting intervals or segments that do not fulfil some required criteria.- Specified by:
isEligibleForCompactionin interfaceCompactionCandidateSearchPolicy
-