Show / Hide Table of Contents

    Class TaskMergeScheduler

    A MergeScheduler that runs each merge using s on the default .

    If more than MaxMergeCount merges are requested then this class will forcefully throttle the incoming threads by pausing until one more more merges complete.

    LUCENENET specific

    Inheritance
    System.Object
    MergeScheduler
    TaskMergeScheduler
    Implements
    IConcurrentMergeScheduler
    IMergeScheduler
    IDisposable
    Inherited Members
    MergeScheduler.Dispose()
    Namespace: Lucene.Net.Index
    Assembly: Lucene.Net.dll
    Syntax
    public class TaskMergeScheduler : MergeScheduler, IConcurrentMergeScheduler, IMergeScheduler, IDisposable

    Constructors

    | Improve this Doc View Source

    TaskMergeScheduler()

    Sole constructor, with all settings set to default values.

    Declaration
    public TaskMergeScheduler()

    Fields

    | Improve this Doc View Source

    COMPONENT_NAME

    Declaration
    public const string COMPONENT_NAME = null
    Field Value
    Type Description
    System.String

    Properties

    | Improve this Doc View Source

    MaxMergeCount

    Max number of merges we accept before forcefully throttling the incoming threads

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

    MaxThreadCount

    Max number of merge threads allowed to be running at once. When there are more merges then this, we forcefully pause the larger ones, letting the smaller ones run, up until MaxMergeCount merges at which point we forcefully pause incoming threads (that presumably are the ones causing so much merging).

    Declaration
    public int MaxThreadCount { get; }
    Property Value
    Type Description
    System.Int32
    See Also
    SetMaxMergesAndThreads(Int32, Int32)
    | Improve this Doc View Source

    MergeThreadPriority

    Return the priority that merge threads run at. This is always the same.

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

    Verbose

    Returns true if verbosing is enabled. This method is usually used in conjunction with Message(String), like that:

    if (Verbose) {
        Message("your message");
    }
    Declaration
    protected bool Verbose { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    ClearSuppressExceptions()

    Used for testing

    Declaration
    public virtual void ClearSuppressExceptions()
    | Improve this Doc View Source

    Clone()

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object
    Overrides
    MergeScheduler.Clone()
    | Improve this Doc View Source

    Dispose(Boolean)

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

    DoMerge(MergePolicy.OneMerge)

    Does the actual merge, by calling Merge(MergePolicy.OneMerge)

    Declaration
    protected virtual void DoMerge(MergePolicy.OneMerge merge)
    Parameters
    Type Name Description
    MergePolicy.OneMerge merge
    | Improve this Doc View Source

    HandleMergeException(Exception)

    Called when an exception is hit in a background merge thread

    Declaration
    protected virtual void HandleMergeException(Exception exc)
    Parameters
    Type Name Description
    Exception exc
    | Improve this Doc View Source

    Merge(IndexWriter, MergeTrigger, Boolean)

    Declaration
    public override void Merge(IndexWriter writer, MergeTrigger trigger, bool newMergesFound)
    Parameters
    Type Name Description
    IndexWriter writer
    MergeTrigger trigger
    System.Boolean newMergesFound
    Overrides
    MergeScheduler.Merge(IndexWriter, MergeTrigger, Boolean)
    | Improve this Doc View Source

    Message(String)

    Outputs the given message - this method assumes Verbose was called and returned true.

    Declaration
    protected virtual void Message(string message)
    Parameters
    Type Name Description
    System.String message
    | Improve this Doc View Source

    SetMaxMergesAndThreads(Int32, Int32)

    Sets the maximum number of merge threads and simultaneous merges allowed.

    Declaration
    public void SetMaxMergesAndThreads(int maxMergeCount, int maxThreadCount)
    Parameters
    Type Name Description
    System.Int32 maxMergeCount

    The max # simultaneous merges that are allowed. If a merge is necessary yet we already have this many threads running, the incoming thread (that is calling add/updateDocument) will block until a merge thread has completed. Note that we will only run the smallest maxThreadCount merges at a time.

    System.Int32 maxThreadCount

    The max # simultaneous merge threads that should be running at once. This must be <= maxMergeCount

    | Improve this Doc View Source

    SetMergeThreadPriority(Int32)

    This method has no effect in TaskMergeScheduler because the MergeThreadPriority returns a constant value.

    Declaration
    public void SetMergeThreadPriority(int priority)
    Parameters
    Type Name Description
    System.Int32 priority
    | Improve this Doc View Source

    SetSuppressExceptions()

    Used for testing

    Declaration
    public virtual void SetSuppressExceptions()
    | Improve this Doc View Source

    Sync()

    Wait for any running merge threads to finish. This call is not interruptible as used by Dispose().

    Declaration
    public virtual void Sync()
    | Improve this Doc View Source

    ToString()

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

    Implements

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