Class TieredMergePolicy
Merges segments of approximately equal size, subject to an allowed number of segments per tier. This is similar to LogByteSizeMergePolicy, except this merge policy is able to merge non-adjacent segment, and separates how many segments are merged at once (MaxMergeAtOnce) from how many segments are allowed per tier (SegmentsPerTier). This merge policy also does not over-merge (i.e. cascade merges).
For normal merging, this policy first computes a "budget" of how many segments are allowed to be in the index. If the index is over-budget, then the policy sorts segments by decreasing size (pro-rating by percent deletes), and then finds the least-cost merge. Merge cost is measured by a combination of the "skew" of the merge (size of largest segment divided by smallest segment), total merge size and percent deletes reclaimed, so that merges with lower skew, smaller size and those reclaiming more deletes, are favored.
If a merge will produce a segment that's larger than MaxMergedSegmentMB, then the policy will merge fewer segments (down to 1 at once, if that one has deletions) to keep the segment size under budget.
NOTE: This policy freely merges non-adjacent segments; if this is a problem, use LogMergePolicy.
NOTE: This policy always merges by byte size of the segments, always pro-rates by percent deletes, and does not apply any maximum segment size during forceMerge (unlike LogByteSizeMergePolicy).
@lucene.experimental
Inherited Members
Assembly: DistributedLucene.Net.dll
Syntax
public class TieredMergePolicy : MergePolicy
Constructors
Name | Description |
---|---|
TieredMergePolicy() | Sole constructor, setting all settings to their defaults. |
Fields
Name | Description |
---|---|
DEFAULT_NO_CFS_RATIO | Default noCFSRatio. If a merge's size is >= 10% of the index, then we disable compound file for it. |
Properties
Name | Description |
---|---|
FloorSegmentMB | Segments smaller than this are "rounded up" to this size, ie treated as equal (floor) size for merge selection. this is to prevent frequent flushing of tiny segments from allowing a long tail in the index. Default is 2 MB. |
ForceMergeDeletesPctAllowed | When forceMergeDeletes is called, we only merge away a segment if its delete percentage is over this threshold. Default is 10%. |
MaxMergeAtOnce | Gets or sets maximum number of segments to be merged at a time during "normal" merging. For explicit merging (eg, ForceMerge(Int32) or ForceMergeDeletes() was called), see MaxMergeAtOnceExplicit. Default is 10. |
MaxMergeAtOnceExplicit | Gets or sets maximum number of segments to be merged at a time, during ForceMerge(Int32) or ForceMergeDeletes(). Default is 30. |
MaxMergedSegmentMB | Gets or sets maximum sized segment to produce during normal merging. This setting is approximate: the estimate of the merged segment size is made by summing sizes of to-be-merged segments (compensating for percent deleted docs). Default is 5 GB. |
ReclaimDeletesWeight | Controls how aggressively merges that reclaim more deletions are favored. Higher values will more aggressively target merges that reclaim deletions, but be careful not to go so high that way too much merging takes place; a value of 3.0 is probably nearly too high. A value of 0.0 means deletions don't impact merge selection. |
SegmentsPerTier | Gets or sets the allowed number of segments per tier. Smaller values mean more merging but fewer segments. NOTE: this value should be >= the MaxMergeAtOnce otherwise you'll force too much merging to occur. Default is 10.0. |
Methods
Name | Description |
---|---|
Dispose(Boolean) | |
FindForcedDeletesMerges(SegmentInfos) | |
FindForcedMerges(SegmentInfos, Int32, IDictionary<SegmentCommitInfo, Nullable<Boolean>>) | |
FindMerges(MergeTrigger, SegmentInfos) | |
Score(IList<SegmentCommitInfo>, Boolean, Int64) | Expert: scores one merge; subclasses can override. |
ToString() |