public class LocalBucketBuilder extends AbstractBucketBuilder<LocalBucketBuilder>
LockFreeBucket
).Constructor and Description |
---|
LocalBucketBuilder() |
Modifier and Type | Method and Description |
---|---|
LocalBucket |
build()
Constructs the bucket using
SynchronizationStrategy.LOCK_FREE synchronization strategy. |
LocalBucketBuilder |
withCustomTimePrecision(TimeMeter customTimeMeter)
Specifies
customTimeMeter time meter for buckets that will be created by this builder. |
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. |
addLimit, buildConfiguration
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 LocalBucket build()
SynchronizationStrategy.LOCK_FREE
synchronization strategy.Copyright © 2018. All rights reserved.