public class GridBucket extends AbstractBucket
bandwidths, configuration, timeMeter, UNSPECIFIED_WAITING_LIMIT
Constructor and Description |
---|
GridBucket(BucketConfiguration configuration,
GridProxy gridProxy,
RecoveryStrategy recoveryStrategy) |
Modifier and Type | Method and Description |
---|---|
protected void |
addTokensImpl(long tokensToAdd) |
protected long |
consumeAsMuchAsPossibleImpl(long limit) |
protected boolean |
consumeOrAwaitImpl(long tokensToConsume,
long waitIfBusyNanosLimit,
boolean uninterruptibly) |
BucketState |
createSnapshot()
Creates the copy of internal state.
|
protected boolean |
tryConsumeImpl(long tokensToConsume) |
addTokens, consume, consume, consumeUninterruptibly, consumeUninterruptibly, getConfiguration, tryConsume, tryConsumeAsMuchAsPossible, tryConsumeAsMuchAsPossible
public GridBucket(BucketConfiguration configuration, GridProxy gridProxy, RecoveryStrategy recoveryStrategy)
protected long consumeAsMuchAsPossibleImpl(long limit)
consumeAsMuchAsPossibleImpl
in class AbstractBucket
protected boolean tryConsumeImpl(long tokensToConsume)
tryConsumeImpl
in class AbstractBucket
protected boolean consumeOrAwaitImpl(long tokensToConsume, long waitIfBusyNanosLimit, boolean uninterruptibly) throws InterruptedException
consumeOrAwaitImpl
in class AbstractBucket
InterruptedException
protected void addTokensImpl(long tokensToAdd)
addTokensImpl
in class AbstractBucket
public BucketState createSnapshot()
Bucket
This method is designed to be used only for monitoring and testing, you should never use this method for business cases.
Copyright © 2017. All rights reserved.