Package io.perl.api.impl
Class ElasticWait
java.lang.Object
io.perl.api.impl.ElasticWait
Class ElasticWait.
-
Constructor Summary
ConstructorsConstructorDescriptionElasticWait(int idleNS, int windowIntervalMS, int minIntervalMS) Constructor ElasticWait initialize all values. -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()This method initializeidleCountto zero.voidsetElastic(long currentIntervalMS) This method sets theelasticCountand initializetotalCountto zero.voidupdateElastic(long elapsedIntervalMS) This method update theelasticCount.booleanChecks ifidleCountis greater thanelasticCount.
-
Constructor Details
-
ElasticWait
public ElasticWait(int idleNS, int windowIntervalMS, int minIntervalMS) Constructor ElasticWait initialize all values.- Parameters:
idleNS- intwindowIntervalMS- intminIntervalMS- int
-
-
Method Details
-
reset
public void reset()This method initializeidleCountto zero. -
waitAndCheck
public boolean waitAndCheck()Checks ifidleCountis greater thanelasticCount.- Returns:
- true if
idleCount>elasticCount.
-
updateElastic
public void updateElastic(long elapsedIntervalMS) This method update theelasticCount.- Parameters:
elapsedIntervalMS- long
-
setElastic
public void setElastic(long currentIntervalMS) This method sets theelasticCountand initializetotalCountto zero.- Parameters:
currentIntervalMS- long
-