Class LocalBucketBuilder


  • public class LocalBucketBuilder
    extends Object
    This builder creates in-memory buckets (LockFreeBucket).
    • Constructor Detail

      • LocalBucketBuilder

        public LocalBucketBuilder()
    • Method Detail

      • addLimit

        public LocalBucketBuilder addLimit​(Bandwidth bandwidth)
        Adds limited bandwidth for all buckets which will be constructed by this builder.
        Parameters:
        bandwidth - limitation
        Returns:
        this builder instance
      • withCustomTimePrecision

        public LocalBucketBuilder withCustomTimePrecision​(TimeMeter customTimeMeter)
        Specifies customTimeMeter time meter for buckets that will be created by this builder.
        Parameters:
        customTimeMeter - object which will measure time.
        Returns:
        this builder instance
      • withSynchronizationStrategy

        public LocalBucketBuilder withSynchronizationStrategy​(SynchronizationStrategy synchronizationStrategy)
        Specifies synchronizationStrategy for buckets that will be created by this builder.
        Parameters:
        synchronizationStrategy - the strategy of synchronization which need to be applied to prevent data-races in multi-threading usage scenario.
        Returns:
        this builder instance
      • withMath

        public LocalBucketBuilder withMath​(MathType mathType)
        Warnings: this is not a part of Public API. This method is intended to be used strongly by internal code and can be removed at any time without prior notice.
        Parameters:
        mathType -
        Returns:
      • build

        public LocalBucket build()
        Constructs the bucket.
        Returns:
        the new bucket