Class LongAdderCounter

  • All Implemented Interfaces:
    org.apache.bookkeeper.stats.Counter

    public class LongAdderCounter
    extends java.lang.Object
    implements org.apache.bookkeeper.stats.Counter
    Counter implementation based on LongAdder.

    LongAdder keeps a counter per-thread and then aggregates to get the result, in order to avoid contention between multiple threads.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(long delta)  
      void clear()  
      void dec()  
      java.lang.Long get()  
      void inc()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LongAdderCounter

        public LongAdderCounter()
    • Method Detail

      • clear

        public void clear()
        Specified by:
        clear in interface org.apache.bookkeeper.stats.Counter
      • inc

        public void inc()
        Specified by:
        inc in interface org.apache.bookkeeper.stats.Counter
      • dec

        public void dec()
        Specified by:
        dec in interface org.apache.bookkeeper.stats.Counter
      • add

        public void add​(long delta)
        Specified by:
        add in interface org.apache.bookkeeper.stats.Counter
      • get

        public java.lang.Long get()
        Specified by:
        get in interface org.apache.bookkeeper.stats.Counter