Class BaseCandidateSearchPolicy
java.lang.Object
org.apache.druid.server.compaction.BaseCandidateSearchPolicy
- All Implemented Interfaces:
CompactionCandidateSearchPolicy
- Direct Known Subclasses:
MostFragmentedIntervalFirstPolicy,NewestSegmentFirstPolicy
@SubclassesMustOverrideEqualsAndHashCode
public abstract class BaseCandidateSearchPolicy
extends Object
implements CompactionCandidateSearchPolicy
Base implementation of
CompactionCandidateSearchPolicy that can have
a priorityDatasource.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckEligibilityForCompaction(CompactionCandidate candidate, CompactionTaskStatus latestTaskStatus) Checks if the givenCompactionCandidateis eligible for compaction in the current iteration.final intCompares between two compaction candidates.booleanfinal StringThe candidates of this datasource are prioritized over all others.protected abstract Comparator<CompactionCandidate>Compares between two compaction candidates.inthashCode()
-
Constructor Details
-
BaseCandidateSearchPolicy
-
-
Method Details
-
getPriorityDatasource
The candidates of this datasource are prioritized over all others. -
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 negative value if
candidateAshould be picked first, a positive value ifcandidateBshould be picked first or zero if the order does not matter.
-
checkEligibilityForCompaction
public Eligibility checkEligibilityForCompaction(CompactionCandidate candidate, 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:
checkEligibilityForCompactionin interfaceCompactionCandidateSearchPolicy- Returns:
Eligibility.FULLonly if eligible.
-
getSegmentComparator
Compares between two compaction candidates. Used to determine the order in which segments and intervals should be picked for compaction. -
equals
-
hashCode
public int hashCode()
-