public final class ForceMergePolicy extends MergePolicyWrapper
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.DocMap, MergePolicy.MergeAbortedException, MergePolicy.MergeException, MergePolicy.MergeSpecification, MergePolicy.OneMerge
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,
IndexWriter writer)
Determine what set of merge operations are now necessary on the index.
|
findForcedDeletesMerges, findForcedMerges, getNoCFSRatio, setMaxCFSSegmentSizeMB, setNoCFSRatio, size, toString, useCompoundFile
getMaxCFSSegmentSizeMB, isMerged
public ForceMergePolicy(MergePolicy in)
ForceMergePolicy
around the given MergePolicy
public MergePolicy.MergeSpecification findMerges(MergeTrigger mergeTrigger, SegmentInfos segmentInfos, IndexWriter writer) throws 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 MergePolicyWrapper
mergeTrigger
- the event that triggered the mergesegmentInfos
- the total set of segments in the indexwriter
- the IndexWriter to find the merges onIOException
Copyright © 2000–2016 The Apache Software Foundation. All rights reserved.