public class EstimationProbe extends Object implements Serializable
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) |
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() |
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 refilledCopyright © 2021. All rights reserved.