Class CounterConfiguration.Builder

    • Method Detail

      • initialValue

        public CounterConfiguration.Builder initialValue​(long initialValue)
        Sets the initial value.

        The default value is zero.

        Parameters:
        initialValue - the new initial value.
      • concurrencyLevel

        public CounterConfiguration.Builder concurrencyLevel​(int concurrencyLevel)
        Sets the concurrency level of the counter.

        Only for CounterType.WEAK.

        The concurrency level set the amount of concurrent updates that can happen simultaneous. It is trade-off between the write performance and read performance. A higher value will allow more concurrent updates, however it will take more time to compute the counter value.

        The default value is 64.

        Parameters:
        concurrencyLevel - the new concurrency level.