Fork me on GitHub
  • API

    Show / Hide Table of Contents

    Class RateLimiter.SimpleRateLimiter

    Simple class to rate limit IO.

    Inheritance
    object
    RateLimiter
    RateLimiter.SimpleRateLimiter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Lucene.Net.Store
    Assembly: Lucene.Net.dll
    Syntax
    public class RateLimiter.SimpleRateLimiter : RateLimiter

    Constructors

    SimpleRateLimiter(double)

    mbPerSec is the MB/sec max IO rate

    Declaration
    public SimpleRateLimiter(double mbPerSec)
    Parameters
    Type Name Description
    double mbPerSec

    Properties

    MbPerSec

    The current mb per second rate limit.

    Declaration
    public override double MbPerSec { get; }
    Property Value
    Type Description
    double
    Overrides
    RateLimiter.MbPerSec

    Methods

    Pause(long)

    Pauses, if necessary, to keep the instantaneous IO rate at or below the target. NOTE: multiple threads may safely use this, however the implementation is not perfectly thread safe but likely in practice this is harmless (just means in some rare cases the rate might exceed the target). It's best to call this with a biggish count, not one byte at a time.

    Declaration
    public override long Pause(long bytes)
    Parameters
    Type Name Description
    long bytes
    Returns
    Type Description
    long

    the pause time in nano seconds

    Overrides
    RateLimiter.Pause(long)

    SetMbPerSec(double)

    Sets an updated mb per second rate limit.

    Declaration
    public override void SetMbPerSec(double mbPerSec)
    Parameters
    Type Name Description
    double mbPerSec
    Overrides
    RateLimiter.SetMbPerSec(double)
    Back to top Copyright © 2024 The Apache Software Foundation, Licensed under the Apache License, Version 2.0
    Apache Lucene.Net, Lucene.Net, Apache, the Apache feather logo, and the Apache Lucene.Net project logo are trademarks of The Apache Software Foundation.
    All other marks mentioned may be trademarks or registered trademarks of their respective owners.