Package org.apache.lucene.index
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
-
Method Summary
Modifier and TypeMethodDescriptionorg.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)
Returntrue
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
-
Constructor Details
-
ShuffleForcedMergePolicy
public ShuffleForcedMergePolicy(org.apache.lucene.index.MergePolicy in)
-
-
Method Details
-
isInterleavedSegment
public static boolean isInterleavedSegment(org.apache.lucene.index.LeafReader reader)Returntrue
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 classorg.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 classorg.apache.lucene.index.FilterMergePolicy
- Throws:
IOException
-