Class XactId

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat, TransactionId

    public class XactId
    extends java.lang.Object
    implements TransactionId
    Use this class for a short hand representation of the transaction. This value is only guarentee to be unique within one continuous operation of the raw store, in other words, every reboot may reuse the same value. Whereas GlobalXactId is unique for all times across all raw store, a XactId is only unique within a particular rawstore and may be reused. XactId keeps track of the outstanding transactionId and is responsible for dispensing new transactionIds
    See Also:
    Serialized Form
    • Field Detail

      • id

        private long id
    • Constructor Detail

      • XactId

        public XactId​(long id)
      • XactId

        public XactId()
    • Method Detail

      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write this out.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException - error writing to log stream
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException
        Read this in
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException - error reading from log stream
      • getTypeFormatId

        public int getTypeFormatId()
        Return my format identifier.
        Specified by:
        getTypeFormatId in interface TypedFormat
        Returns:
        The identifier. (A UUID stuffed in an array of 16 bytes).
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • compare

        public static long compare​(TransactionId a,
                                   TransactionId b)
        Return 0 if a == b, +ve number if a > b -ve number if a < b
      • getId

        protected long getId()
      • toString

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