fabric.common
Class TransactionID

java.lang.Object
  extended by fabric.common.TransactionID
All Implemented Interfaces:
FastSerializable, java.io.Serializable

public class TransactionID
extends java.lang.Object
implements FastSerializable, java.io.Serializable

See Also:
Serialized Form

Field Summary
 int depth
          The nesting depth of this transaction.
 TransactionID parent
           
 long tid
          The tid for this nested transaction.
 long topTid
          The tid for the top-level transaction.
 
Constructor Summary
TransactionID()
           
TransactionID(java.io.DataInput in)
          Deserialization constructor.
TransactionID(long tid)
          Creates a new top-level transaction id with the given id.
TransactionID(TransactionID parent)
          Creates a new transaction ID that is a child of the given tid.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean equals(TransactionID tid)
           
 TransactionID getLowestCommonAncestor(TransactionID tid)
           
 boolean isDescendantOf(TransactionID tid)
           
 void write(java.io.DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

public final TransactionID parent

tid

public final long tid
The tid for this nested transaction.


topTid

public final long topTid
The tid for the top-level transaction.


depth

public final int depth
The nesting depth of this transaction. Top-level transactions have depth 0.

Constructor Detail

TransactionID

public TransactionID()

TransactionID

public TransactionID(long tid)
Creates a new top-level transaction id with the given id.


TransactionID

public TransactionID(TransactionID parent)
Creates a new transaction ID that is a child of the given tid.

Parameters:
parent -

TransactionID

public TransactionID(java.io.DataInput in)
              throws java.io.IOException
Deserialization constructor.

Throws:
java.io.IOException
Method Detail

write

public void write(java.io.DataOutput out)
           throws java.io.IOException
Specified by:
write in interface FastSerializable
Throws:
java.io.IOException

isDescendantOf

public boolean isDescendantOf(TransactionID tid)
Returns:
true iff the transaction represented by this tid is a descendant of (or is the same as) the one represented by the given tid.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(TransactionID tid)

getLowestCommonAncestor

public TransactionID getLowestCommonAncestor(TransactionID tid)
Returns:
the longest tid that is an ancestor of both this tid and the given tid.