K
- public class GridBucket<K extends Serializable> extends AbstractBucket
UNSPECIFIED_WAITING_LIMIT
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,
BlockingStrategy blockingStrategy) |
static <T extends Serializable> |
createInitializedBucket(T key,
BucketConfiguration configuration,
GridProxy<T> gridProxy,
RecoveryStrategy recoveryStrategy) |
static <T extends Serializable> |
createLazyBucket(T key,
Supplier<BucketConfiguration> configurationSupplier,
GridProxy<T> gridProxy) |
BucketState |
createSnapshot()
Creates the copy of internal state.
|
BucketConfiguration |
getConfiguration()
Returns configuration of this bucket.
|
protected boolean |
tryConsumeImpl(long tokensToConsume) |
addTokens, consume, consume, consumeUninterruptibly, consumeUninterruptibly, tryConsume, tryConsumeAsMuchAsPossible, tryConsumeAsMuchAsPossible
public static <T extends Serializable> GridBucket<T> createLazyBucket(T key, Supplier<BucketConfiguration> configurationSupplier, GridProxy<T> gridProxy)
public static <T extends Serializable> GridBucket<T> createInitializedBucket(T key, BucketConfiguration configuration, GridProxy<T> 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, BlockingStrategy blockingStrategy) 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.
public BucketConfiguration getConfiguration()
Bucket
Copyright © 2017. All rights reserved.