Class TransInteger

  • All Implemented Interfaces:
    TransactionalComponent

    public class TransInteger
    extends TransactionalComponentLifecycle<org.apache.jena.dboe.transaction.TransInteger.IntegerState>
    A transaction component with an integer supporting MR+SW (=one writer AND many readers).
    • Constructor Detail

      • TransInteger

        public TransInteger()
        In-memory, non persistent, transactional integer
      • TransInteger

        public TransInteger​(long v)
        In-memory, non persistent, transactional integer
      • TransInteger

        public TransInteger​(long v,
                            ComponentId componentId)
        In-memory, non persistent, transactional integer
      • TransInteger

        public TransInteger​(java.lang.String filename,
                            ComponentId cid)
        Persistent, transactional integer. The persistent state is held in filename. When first initialized, the value is 0L.
        Parameters:
        filename - Persistent state
        cid - Component id
    • Method Detail

      • cleanStart

        public void cleanStart()
        Description copied from interface: TransactionalComponent
        Indicate that no recovery is being done (the journal thinks everything was completed last time)
      • inc

        public void inc()
        Set the value, return the old value
      • set

        public long set​(long x)
        Set the value, return the old value
      • read

        public long read()
        Return the current value in a transaction. s
      • get

        public long get()
        Return the current value. If inside a transaction, return the transaction view of the value. If not in a transaction return the state value (effectively a read transaction, optimized by the fact that reading the TransInteger state is atomic).
      • value

        public long value()
        Read the current global state (that is, the last committed value) outside a transaction.
      • toString

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