Class BaseCandidateSearchPolicy
java.lang.Object
org.apache.druid.server.compaction.BaseCandidateSearchPolicy
- All Implemented Interfaces:
CompactionCandidateSearchPolicy
- Direct Known Subclasses:
NewestSegmentFirstPolicy
public abstract class BaseCandidateSearchPolicy
extends Object
implements CompactionCandidateSearchPolicy
Base implementation of
CompactionCandidateSearchPolicy that can have
a priorityDatasource.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal 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()booleanisEligibleForCompaction(CompactionCandidate candidate, CompactionStatus currentCompactionStatus, CompactionTaskStatus latestTaskStatus) Checks if the givenCompactionCandidateis eligible for compaction in the current iteration.
-
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 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
-
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()
-