Class ShuffleForcedMergePolicy

java.lang.Object
org.apache.lucene.index.MergePolicy
org.apache.lucene.index.FilterMergePolicy
org.apache.lucene.index.ShuffleForcedMergePolicy

public class ShuffleForcedMergePolicy extends org.apache.lucene.index.FilterMergePolicy
A FilterMergePolicy that interleaves eldest and newest segments picked by MergePolicy.findForcedMerges(org.apache.lucene.index.SegmentInfos, int, java.util.Map<org.apache.lucene.index.SegmentCommitInfo, java.lang.Boolean>, org.apache.lucene.index.MergePolicy.MergeContext) and MergePolicy.findForcedDeletesMerges(org.apache.lucene.index.SegmentInfos, org.apache.lucene.index.MergePolicy.MergeContext). This allows time-based indices, that usually have the eldest documents first, to be efficient at finding the most recent documents too.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.lucene.index.MergePolicy

    org.apache.lucene.index.MergePolicy.MergeAbortedException, org.apache.lucene.index.MergePolicy.MergeContext, org.apache.lucene.index.MergePolicy.MergeException, org.apache.lucene.index.MergePolicy.MergeSpecification, org.apache.lucene.index.MergePolicy.OneMerge, org.apache.lucene.index.MergePolicy.OneMergeProgress
  • Field Summary

    Fields inherited from class org.apache.lucene.index.FilterMergePolicy

    in

    Fields inherited from class org.apache.lucene.index.MergePolicy

    DEFAULT_MAX_CFS_SEGMENT_SIZE, DEFAULT_NO_CFS_RATIO, maxCFSSegmentSize, noCFSRatio
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShuffleForcedMergePolicy(org.apache.lucene.index.MergePolicy in)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.lucene.index.MergePolicy.MergeSpecification
    findForcedDeletesMerges(org.apache.lucene.index.SegmentInfos segmentInfos, org.apache.lucene.index.MergePolicy.MergeContext mergeContext)
     
    org.apache.lucene.index.MergePolicy.MergeSpecification
    findForcedMerges(org.apache.lucene.index.SegmentInfos segmentInfos, int maxSegmentCount, Map<org.apache.lucene.index.SegmentCommitInfo,Boolean> segmentsToMerge, org.apache.lucene.index.MergePolicy.MergeContext mergeContext)
     
    static boolean
    isInterleavedSegment(org.apache.lucene.index.LeafReader reader)
    Return true if the provided reader was merged with interleaved segments.

    Methods inherited from class org.apache.lucene.index.FilterMergePolicy

    findFullFlushMerges, findMerges, getMaxCFSSegmentSizeMB, getNoCFSRatio, keepFullyDeletedSegment, numDeletesToMerge, setMaxCFSSegmentSizeMB, setNoCFSRatio, size, toString, useCompoundFile

    Methods inherited from class org.apache.lucene.index.MergePolicy

    assertDelCount, isMerged, message, segString, verbose

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ShuffleForcedMergePolicy

      public ShuffleForcedMergePolicy(org.apache.lucene.index.MergePolicy in)
  • Method Details

    • isInterleavedSegment

      public static boolean isInterleavedSegment(org.apache.lucene.index.LeafReader reader)
      Return true if the provided reader was merged with interleaved segments.
    • findForcedDeletesMerges

      public org.apache.lucene.index.MergePolicy.MergeSpecification findForcedDeletesMerges(org.apache.lucene.index.SegmentInfos segmentInfos, org.apache.lucene.index.MergePolicy.MergeContext mergeContext) throws IOException
      Overrides:
      findForcedDeletesMerges in class org.apache.lucene.index.FilterMergePolicy
      Throws:
      IOException
    • findForcedMerges

      public org.apache.lucene.index.MergePolicy.MergeSpecification findForcedMerges(org.apache.lucene.index.SegmentInfos segmentInfos, int maxSegmentCount, Map<org.apache.lucene.index.SegmentCommitInfo,Boolean> segmentsToMerge, org.apache.lucene.index.MergePolicy.MergeContext mergeContext) throws IOException
      Overrides:
      findForcedMerges in class org.apache.lucene.index.FilterMergePolicy
      Throws:
      IOException