public class EstimationProbe extends Object implements ComparableByContent<EstimationProbe>
Modifier and Type | Field and Description |
---|---|
static SerializationHandle<EstimationProbe> |
SERIALIZATION_HANDLE |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeConsumed()
Flag describes result of consumption operation.
|
static EstimationProbe |
canBeConsumed(long remainingTokens) |
static EstimationProbe |
canNotBeConsumed(long remainingTokens,
long nanosToWaitForRefill) |
boolean |
equalsByContent(EstimationProbe other) |
long |
getNanosToWaitForRefill()
Returns zero if
canBeConsumed() returns true, else time in nanos which need to wait until requested amount of tokens will be refilled |
long |
getRemainingTokens()
Return the tokens remaining in the bucket
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals
public static final SerializationHandle<EstimationProbe> SERIALIZATION_HANDLE
public static EstimationProbe canBeConsumed(long remainingTokens)
public static EstimationProbe canNotBeConsumed(long remainingTokens, long nanosToWaitForRefill)
public boolean canBeConsumed()
public long getRemainingTokens()
public long getNanosToWaitForRefill()
canBeConsumed()
returns true, else time in nanos which need to wait until requested amount of tokens will be refilledcanBeConsumed()
returns true, else time in nanos which need to wait until requested amount of tokens will be refilledpublic boolean equalsByContent(EstimationProbe other)
equalsByContent
in interface ComparableByContent<EstimationProbe>
Copyright © 2022. All rights reserved.