Interface CompactionCandidateSearchPolicy
- All Known Implementing Classes:
BaseCandidateSearchPolicy,FixedIntervalOrderPolicy,NewestSegmentFirstPolicy
public interface CompactionCandidateSearchPolicy
Policy used by
CompactSegments duty to pick segments for compaction.-
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.
-
Method Details
-
compareCandidates
Compares between two compaction candidates. Used to determine the order in which segments and intervals should be picked for compaction.- 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
boolean isEligibleForCompaction(CompactionCandidate candidate, CompactionStatus currentCompactionStatus, CompactionTaskStatus latestTaskStatus) Checks 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.
-