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.OneMergeProgress
in
DEFAULT_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, useCompoundFile
assertDelCount, isMerged, message, segString, verbose
public ForceMergePolicy(MergePolicy in)
ForceMergePolicy
around the given MergePolicy
public MergePolicy.MergeSpecification findMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos, MergePolicy.MergeContext mergeContext) throws java.io.IOException
MergePolicy
IndexWriter
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 FilterMergePolicy
mergeTrigger
- the event that triggered the mergesegmentInfos
- the total set of segments in the indexmergeContext
- the IndexWriter to find the merges onjava.io.IOException
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.