Class MVStore.TxCounter

  • Enclosing class:
    MVStore

    public static final class MVStore.TxCounter
    extends java.lang.Object
    Class TxCounter is a simple data structure to hold version of the store along with the counter of open transactions, which are still operating on this version.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int counter
      Counter of outstanding operation on this version of a store
      private static java.util.concurrent.atomic.AtomicIntegerFieldUpdater<MVStore.TxCounter> counterUpdater  
      long version
      Version of a store, this TxCounter is related to
    • Constructor Summary

      Constructors 
      Constructor Description
      TxCounter​(long version)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) int decrementAndGet()
      Decrement and get the counter values.
      (package private) int get()  
      (package private) int incrementAndGet()
      Increment and get the counter value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • version

        public final long version
        Version of a store, this TxCounter is related to
      • counter

        private volatile int counter
        Counter of outstanding operation on this version of a store
      • counterUpdater

        private static final java.util.concurrent.atomic.AtomicIntegerFieldUpdater<MVStore.TxCounter> counterUpdater
    • Constructor Detail

      • TxCounter

        TxCounter​(long version)
    • Method Detail

      • get

        int get()
      • incrementAndGet

        int incrementAndGet()
        Increment and get the counter value.
        Returns:
        the new value
      • decrementAndGet

        int decrementAndGet()
        Decrement and get the counter values.
        Returns:
        the new value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object