Bucket.addTokens(long), follows the same semantic.Bucket.addTokens(long)Bucket.addTokens(long)ScheduledExecutorService in case of lack of tokens.BucketProxy.AbstractCompareAndSwapBasedProxyManager typically performs in reaction to user request.AsyncBucketProxy.ProxyManager.AsyncBucketProxy API.ClientSideConfig with configured backwardCompatibilityVersion.BlockingBucketDefaultBucketProxy found that bucket state has been lost,
and DefaultBucketProxy is unable to repair bucket state or recovery strategy is RecoveryStrategy.THROW_BUCKET_NOT_FOUND_EXCEPTION.BandwidthDataSource as a required parameterRemoteAsyncBucketBuilder.build(Object, Supplier) instead. This method will be removed soonRemoteAsyncBucketBuilder.build(Object, BucketConfiguration),
but additionally provides ability to provide configuration lazily, that can be helpful when figuring-out the right configuration parameters
is costly, for example because parameters for particular key are stored in external database,
configurationSupplier will be called if and only if bucket has not been persisted before.RemoteBucketBuilder.build(Object, BucketConfiguration),
but additionally provides ability to provide configuration lazily, that can be helpful when figuring-out the right configuration parameters
is costly, for example because parameters for particular key are stored in external database,
configurationSupplier will be called if and only if bucket has not been persisted before.RemoteBucketBuilder.build(Object, Supplier) instead. This method will be removed soonBandwidthRemoteAsyncBucketBuilderProxyManager such as:
Backward compatibility version, see ClientSideConfig.backwardCompatibleWith(Version) for more details.
Client-side clock, see ClientSideConfig.withClientClock(TimeMeter) for more details.
BucketConfigurationBlockingBucket.consume(long, BlockingStrategy)tokens from bucket ignoring all limits.Bucket.consumeIgnoringRateLimits(long), follows the same semantic.Bucket.consumeIgnoringRateLimits(long)Bucket.consumeIgnoringRateLimits(long)BlockingBucket.consume(long, BlockingStrategy) but ignores interrupts(just restores interruption flag on exit).BlockingBucket.consumeUninterruptibly(long, UninterruptibleBlockingStrategy)DefaultOptimizationListenerDelayOptimization.DelayParametersBucket.estimateAbilityToConsume(long), follows the same semantic.Bucket.estimateAbilityToConsume(long)Bucket.estimateAbilityToConsume(long)Bucket.forceAddTokens(long), follows the same semantic.Bucket.addTokens(long)Bucket.forceAddTokens(long)Bucket.getAvailableTokens()Bucket.getAvailableTokens()ConsumptionProbe.isConsumed() returns true, else time in nanos which need to wait until requested amount of tokens will be refilledEstimationProbe.canBeConsumed() returns true, else time in nanos which need to wait until requested amount of tokens will be refilledBandwidth has amount tokens that equals its capacity.true if implementation of clock behaves the similar way as System.currentTimeMillis(),
in other words if implementation can be used as wall clock.LockFreeBucket).AbstractLockBasedProxyManager typically performs in reaction to user request.OptimizationController.syncImmediately().tokens is consumed.ScheduledExecutorService because of wait for tokens refill
in result of interaction with SchedulingBucketBlockingBucketBlockingBuckettokens is rejected.BucketProxy and AsyncBucketProxy.BucketProxy.DelayOptimization.Optimizations.predicting(DelayParameters, PredictionParameters) but uses default PredictionParameters.PredictiveOptimizationPredictionParametersAsyncBucketProxyBucketProxyVerboseBucket and AsyncVerboseBucket.Bucket.replaceConfiguration(BucketConfiguration, TokensInheritanceStrategy)Bucket.replaceConfiguration(BucketConfiguration, TokensInheritanceStrategy)Bucket.replaceConfiguration(BucketConfiguration, TokensInheritanceStrategy)Bucket.reset()Bucket.reset()Bucket.AbstractSelectForUpdateBasedProxyManager typically performs in reaction to user request.true:
Accumulated amount of locally consumed tokens without external synchronization is greater than or equal to unsynchronizedTokens
Time passed since last synchronization with external storage is greater than or equal to timeSinceLastSync
true:
Accumulated amount of locally consumed tokens without external synchronization is greater than or equal to unsynchronizedTokens
Time passed since last synchronization with external storage is greater than or equal to timeSinceLastSync
TimeMeter which works around System.currentTimeMillis()TimeMeter which works around System.nanoTime()LocalBucket.fromBinarySnapshot(byte[]) to restore bucket from snapshot.LocalBucket.fromJsonCompatibleSnapshot(Map) to restore bucket from snapshot.Bucket.replaceConfiguration(BucketConfiguration, TokensInheritanceStrategy) happens.listener.listener.BlockingBucket.tryConsume(long, long, BlockingStrategy)BlockingBucket.tryConsume(long, long, BlockingStrategy)BlockingBucket.tryConsume(long, long, BlockingStrategy)Bucket.tryConsume(long), follows the same semantic.Bucket.tryConsume(long)SchedulingBucket.tryConsume(long, long, ScheduledExecutorService)Bucket.tryConsume(long)Bucket.tryConsumeAndReturnRemaining(long), follows the same semantic.Bucket.tryConsumeAndReturnRemaining(long)Bucket.tryConsumeAndReturnRemaining(long)limit.Bucket.tryConsumeAsMuchAsPossible(), follows the same semantic.Bucket.tryConsumeAsMuchAsPossible(long), follows the same semantic.Bucket.tryConsumeAsMuchAsPossible()Bucket.tryConsumeAsMuchAsPossible(long)Bucket.tryConsumeAsMuchAsPossible()Bucket.tryConsumeAsMuchAsPossible(long)BlockingBucket.tryConsume(long, long, BlockingStrategy) but ignores interrupts(just restores interruption flag on exit).BlockingBucket.tryConsumeUninterruptibly(long, long, UninterruptibleBlockingStrategy)BlockingBucket.tryConsumeUninterruptibly(long, long, UninterruptibleBlockingStrategy)BlockingBucket.tryConsumeUninterruptibly(long, long, UninterruptibleBlockingStrategy)Bucket API.VerboseBucket and AsyncVerboseBucket.ClientSideConfig with configured clientClock.customTimeMeter time meter for buckets that will be created by this builder.ClientSideConfig with configured executionStrategy.ClientSideConfig with configured strategy for choosing time to live for buckets.TimeMeter.SYSTEM_MILLISECONDS as time meter for buckets that will be created by this builder.TimeMeter.SYSTEM_NANOTIME as time meter for buckets that will be created by this builder.RecoveryStrategy.RECONSTRUCT that is used by default.RecoveryStrategy.RECONSTRUCT that is used by default.ClientSideConfig with configured timeout for remote operations.synchronizationStrategy for buckets that will be created by this builder.Copyright © 2024. All rights reserved.