public class LocalBucketBuilder extends Object
LockFreeBucket).| Constructor and Description |
|---|
LocalBucketBuilder() |
| Modifier and Type | Method and Description |
|---|---|
LocalBucketBuilder |
addLimit(Bandwidth bandwidth)
Adds limited bandwidth for all buckets which will be constructed by this builder.
|
LocalBucketBuilder |
addLimit(Function<BandwidthBuilder.BandwidthBuilderCapacityStage,BandwidthBuilder.BandwidthBuilderBuildStage> bandwidthConfigurator) |
LocalBucket |
build()
Constructs the bucket.
|
LocalBucketBuilder |
withCustomTimePrecision(TimeMeter customTimeMeter)
Specifies
customTimeMeter time meter for buckets that will be created by this builder. |
LocalBucketBuilder |
withMath(MathType mathType)
Warnings: this is not a part of Public API.
|
LocalBucketBuilder |
withMillisecondPrecision()
Specifies
TimeMeter.SYSTEM_MILLISECONDS as time meter for buckets that will be created by this builder. |
LocalBucketBuilder |
withNanosecondPrecision()
Specifies
TimeMeter.SYSTEM_NANOTIME as time meter for buckets that will be created by this builder. |
LocalBucketBuilder |
withSynchronizationStrategy(SynchronizationStrategy synchronizationStrategy)
Specifies
synchronizationStrategy for buckets that will be created by this builder. |
public LocalBucketBuilder addLimit(Bandwidth bandwidth)
bandwidth - limitationpublic LocalBucketBuilder addLimit(Function<BandwidthBuilder.BandwidthBuilderCapacityStage,BandwidthBuilder.BandwidthBuilderBuildStage> bandwidthConfigurator)
public LocalBucketBuilder withNanosecondPrecision()
TimeMeter.SYSTEM_NANOTIME as time meter for buckets that will be created by this builder.public LocalBucketBuilder withMillisecondPrecision()
TimeMeter.SYSTEM_MILLISECONDS as time meter for buckets that will be created by this builder.public LocalBucketBuilder withCustomTimePrecision(TimeMeter customTimeMeter)
customTimeMeter time meter for buckets that will be created by this builder.customTimeMeter - object which will measure time.public LocalBucketBuilder withSynchronizationStrategy(SynchronizationStrategy synchronizationStrategy)
synchronizationStrategy for buckets that will be created by this builder.synchronizationStrategy - the strategy of synchronization which need to be applied to prevent data-races in multi-threading usage scenario.public LocalBucketBuilder withMath(MathType mathType)
mathType - public LocalBucket build()
Copyright © 2024. All rights reserved.