public final class ForceMergePolicy extends FilterMergePolicy
MergePolicy that only returns forced merges.
NOTE: Use this policy if you wish to disallow background merges but wish to run optimize/forceMerge segment merges.
MergePolicy.MergeAbortedException, MergePolicy.MergeContext, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.OneMerge, MergePolicy.OneMergeProgressinDEFAULT_MAX_CFS_SEGMENT_SIZE, DEFAULT_NO_CFS_RATIO, maxCFSSegmentSize, noCFSRatio| Constructor and Description |
|---|
ForceMergePolicy(MergePolicy in)
Create a new
ForceMergePolicy around the given MergePolicy |
| Modifier and Type | Method and Description |
|---|---|
MergePolicy.MergeSpecification |
findMerges(MergeTrigger mergeTrigger,
SegmentInfos segmentInfos,
MergePolicy.MergeContext mergeContext)
Determine what set of merge operations are now necessary on the index.
|
findForcedDeletesMerges, findForcedMerges, getMaxCFSSegmentSizeMB, getNoCFSRatio, keepFullyDeletedSegment, numDeletesToMerge, setMaxCFSSegmentSizeMB, setNoCFSRatio, size, toString, useCompoundFileassertDelCount, isMerged, message, segString, verbosepublic ForceMergePolicy(MergePolicy in)
ForceMergePolicy around the given MergePolicypublic MergePolicy.MergeSpecification findMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos, MergePolicy.MergeContext mergeContext) throws java.io.IOException
MergePolicyIndexWriter calls this whenever there is a change to the segments.
This call is always synchronized on the IndexWriter instance so
only one thread at a time will call this method.findMerges in class FilterMergePolicymergeTrigger - the event that triggered the mergesegmentInfos - the total set of segments in the indexmergeContext - the IndexWriter to find the merges onjava.io.IOExceptionCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.