Class SequentialWeightsThrottle

  • All Implemented Interfaces:
    IndexThrottle

    public final class SequentialWeightsThrottle
    extends java.lang.Object
    implements IndexThrottle
    Created by kurila on 29.03.16. An throttle which uses the map of weights. The throttle determines the weight for each I/O task and makes the decision. The weight is used to pass the I/O task with specific ratio for the different keys.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean tryAcquire​(int index)  
      int tryAcquire​(int index, int times)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SequentialWeightsThrottle

        public SequentialWeightsThrottle​(int[] weights)
                                  throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
    • Method Detail

      • tryAcquire

        public final boolean tryAcquire​(int index)
        Specified by:
        tryAcquire in interface IndexThrottle
      • tryAcquire

        public final int tryAcquire​(int index,
                                    int times)
        Specified by:
        tryAcquire in interface IndexThrottle