Interface CompactionCandidateSearchPolicy

All Known Implementing Classes:
BaseCandidateSearchPolicy, FixedIntervalOrderPolicy, MostFragmentedIntervalFirstPolicy, NewestSegmentFirstPolicy

public interface CompactionCandidateSearchPolicy
Policy used by CompactSegments duty to pick segments for compaction.
  • Method Details

    • compareCandidates

      int compareCandidates(CompactionCandidate candidateA, CompactionCandidate candidateB)
      Compares between two compaction candidates. Used to determine the order in which segments and intervals should be picked for compaction.
      Returns:
      A negative value if candidateA should be picked first, a positive value if candidateB should be picked first or zero if the order does not matter.
    • checkEligibilityForCompaction

      Eligibility checkEligibilityForCompaction(CompactionCandidate candidate, CompactionTaskStatus latestTaskStatus)
      Checks if the given CompactionCandidate is 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.
      Returns:
      Eligibility.FULL only if eligible.