• API

    Show / Hide Table of Contents

    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).

    This is a Lucene.NET EXPERIMENTAL API, use at your own risk
    Inheritance
    System.Object
    MergePolicy
    TieredMergePolicy
    Implements
    System.IDisposable
    Inherited Members
    MergePolicy.DEFAULT_MAX_CFS_SEGMENT_SIZE
    MergePolicy.m_writer
    MergePolicy.m_noCFSRatio
    MergePolicy.m_maxCFSSegmentSize
    MergePolicy.Clone()
    MergePolicy.SetIndexWriter(IndexWriter)
    MergePolicy.Dispose()
    MergePolicy.UseCompoundFile(SegmentInfos, SegmentCommitInfo)
    MergePolicy.Size(SegmentCommitInfo)
    MergePolicy.IsMerged(SegmentInfos, SegmentCommitInfo)
    MergePolicy.NoCFSRatio
    MergePolicy.MaxCFSSegmentSizeMB
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public class TieredMergePolicy : MergePolicy, IDisposable

    Constructors

    | Improve this Doc View Source

    TieredMergePolicy()

    Sole constructor, setting all settings to their defaults.

    Declaration
    public TieredMergePolicy()

    Fields

    | Improve this Doc View Source

    DEFAULT_NO_CFS_RATIO

    Default noCFSRatio. If a merge's size is >= 10% of the index, then we disable compound file for it.

    Declaration
    public static readonly double DEFAULT_NO_CFS_RATIO
    Field Value
    Type Description
    System.Double
    See Also
    NoCFSRatio

    Properties

    | Improve this Doc View Source

    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.

    Declaration
    public virtual double FloorSegmentMB { get; set; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    ForceMergeDeletesPctAllowed

    When forceMergeDeletes is called, we only merge away a segment if its delete percentage is over this threshold. Default is 10%.

    Declaration
    public virtual double ForceMergeDeletesPctAllowed { get; set; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    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.

    Declaration
    public virtual int MaxMergeAtOnce { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    MaxMergeAtOnceExplicit

    Gets or sets maximum number of segments to be merged at a time, during ForceMerge(Int32) or ForceMergeDeletes(). Default is 30.

    Declaration
    public virtual int MaxMergeAtOnceExplicit { get; set; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    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.

    Declaration
    public virtual double MaxMergedSegmentMB { get; set; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    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.

    Declaration
    public virtual double ReclaimDeletesWeight { get; set; }
    Property Value
    Type Description
    System.Double
    | Improve this Doc View Source

    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.

    Declaration
    public virtual double SegmentsPerTier { get; set; }
    Property Value
    Type Description
    System.Double

    Methods

    | Improve this Doc View Source

    Dispose(Boolean)

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing
    Overrides
    MergePolicy.Dispose(Boolean)
    | Improve this Doc View Source

    FindForcedDeletesMerges(SegmentInfos)

    Declaration
    public override MergePolicy.MergeSpecification FindForcedDeletesMerges(SegmentInfos infos)
    Parameters
    Type Name Description
    SegmentInfos infos
    Returns
    Type Description
    MergePolicy.MergeSpecification
    Overrides
    MergePolicy.FindForcedDeletesMerges(SegmentInfos)
    | Improve this Doc View Source

    FindForcedMerges(SegmentInfos, Int32, IDictionary<SegmentCommitInfo, Nullable<Boolean>>)

    Declaration
    public override MergePolicy.MergeSpecification FindForcedMerges(SegmentInfos infos, int maxSegmentCount, IDictionary<SegmentCommitInfo, bool?> segmentsToMerge)
    Parameters
    Type Name Description
    SegmentInfos infos
    System.Int32 maxSegmentCount
    System.Collections.Generic.IDictionary<SegmentCommitInfo, System.Nullable<System.Boolean>> segmentsToMerge
    Returns
    Type Description
    MergePolicy.MergeSpecification
    Overrides
    MergePolicy.FindForcedMerges(SegmentInfos, Int32, IDictionary<SegmentCommitInfo, Nullable<Boolean>>)
    | Improve this Doc View Source

    FindMerges(MergeTrigger, SegmentInfos)

    Declaration
    public override MergePolicy.MergeSpecification FindMerges(MergeTrigger mergeTrigger, SegmentInfos infos)
    Parameters
    Type Name Description
    MergeTrigger mergeTrigger
    SegmentInfos infos
    Returns
    Type Description
    MergePolicy.MergeSpecification
    Overrides
    MergePolicy.FindMerges(MergeTrigger, SegmentInfos)
    | Improve this Doc View Source

    Score(IList<SegmentCommitInfo>, Boolean, Int64)

    Expert: scores one merge; subclasses can override.

    Declaration
    protected virtual TieredMergePolicy.MergeScore Score(IList<SegmentCommitInfo> candidate, bool hitTooLarge, long mergingBytes)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<SegmentCommitInfo> candidate
    System.Boolean hitTooLarge
    System.Int64 mergingBytes
    Returns
    Type Description
    TieredMergePolicy.MergeScore
    | Improve this Doc View Source

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    Implements

    System.IDisposable
    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)