Class FixedSizeStripedLongCounter

  • All Implemented Interfaces:
    Counter

    public abstract class FixedSizeStripedLongCounter
    extends Object
    implements Counter
    • Field Detail

      • CACHE_LINE_IN_LONGS

        protected static final int CACHE_LINE_IN_LONGS
      • COUNTER_ARRAY_BASE

        protected static final long COUNTER_ARRAY_BASE
      • ELEMENT_SHIFT

        protected static final long ELEMENT_SHIFT
      • cells

        protected final long[] cells
      • mask

        protected final int mask
    • Constructor Detail

      • FixedSizeStripedLongCounter

        public FixedSizeStripedLongCounter​(int stripesCount)
    • Method Detail

      • inc

        public void inc()
        Specified by:
        inc in interface Counter
      • inc

        public void inc​(long delta)
        Specified by:
        inc in interface Counter
      • get

        public long get()
        Specified by:
        get in interface Counter
      • getAndReset

        public long getAndReset()
        Specified by:
        getAndReset in interface Counter
      • inc

        protected abstract void inc​(long[] cells,
                                    long offset,
                                    long value)
      • getAndReset

        protected abstract long getAndReset​(long[] cells,
                                            long offset)