Class ElasticWait

java.lang.Object
io.perl.api.impl.ElasticWait

@NotThreadSafe public final class ElasticWait extends Object
Class ElasticWait.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ElasticWait(int idleNS, int windowIntervalMS, int minIntervalMS)
    Constructor ElasticWait initialize all values.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method initialize idleCount to zero.
    void
    setElastic(long currentIntervalMS)
    This method sets the elasticCount and initialize totalCount to zero.
    void
    updateElastic(long elapsedIntervalMS)
    This method update the elasticCount.
    boolean
    Checks if idleCount is greater than elasticCount.

    Methods inherited from class java.lang.Object

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

    • ElasticWait

      public ElasticWait(int idleNS, int windowIntervalMS, int minIntervalMS)
      Constructor ElasticWait initialize all values.
      Parameters:
      idleNS - int
      windowIntervalMS - int
      minIntervalMS - int
  • Method Details

    • reset

      public void reset()
      This method initialize idleCount to zero.
    • waitAndCheck

      public boolean waitAndCheck()
      Checks if idleCount is greater than elasticCount.
      Returns:
      true if idleCount > elasticCount.
    • updateElastic

      public void updateElastic(long elapsedIntervalMS)
      This method update the elasticCount.
      Parameters:
      elapsedIntervalMS - long
    • setElastic

      public void setElastic(long currentIntervalMS)
      This method sets the elasticCount and initialize totalCount to zero.
      Parameters:
      currentIntervalMS - long