org.apache.lucene.store

Class RateLimiter

    • Method Detail

      • setMBPerSec

        public abstract void setMBPerSec(double mbPerSec)
        Sets an updated MB per second rate limit.
      • getMBPerSec

        public abstract double getMBPerSec()
        The current MB per second rate limit.
      • pause

        public abstract long pause(long bytes)
                            throws IOException
        Pauses, if necessary, to keep the instantaneous IO rate at or below the target.

        Note: the implementation is thread-safe

        Returns:
        the pause time in nano seconds
        Throws:
        IOException