com.sleepycat.je
Class CommitToken
java.lang.Object
com.sleepycat.je.CommitToken
- All Implemented Interfaces:
- Serializable, Comparable<CommitToken>
public class CommitToken
- extends Object
- implements Serializable, Comparable<CommitToken>
Defines an opaque token that can be used to identify a specific transaction
commit in a replicated environment. It's unique relative to its environment.
Since CommitTokens identify a point in the serialized transaction schedule
created on the master, it's meaningful to compare commit tokens,
as described in the compareTo(CommitToken)
method below.
CommitTokens are obtained from Transaction.getCommitToken()
- See Also:
CommitPointConsistencyPolicy
,
Serialized Form
CommitToken
public CommitToken(UUID repenvUUID,
long vlsn)
- Parameters:
repenvUUID
- identifies the replicated environment associated with
the vlsn
vlsn
- the vlsn representing the state of the database.
getRepenvUUID
public UUID getRepenvUUID()
getVLSN
public long getVLSN()
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals
in class Object
compareTo
public int compareTo(CommitToken other)
- Implements the Comparable interface. Note that it's not meaningful to
compare commit tokens across environments, since they represent
states in unrelated serialized transaction streams.
CommitToken(1) < CommitToken(2) implies that CommitToken(1) represents
a state of the database that preceded the state defined by
CommitToken(2).
- Specified by:
compareTo
in interface Comparable<CommitToken>
- Throws:
IllegalArgumentException
- if two tokens from different
environments are compared.
toString
public String toString()
- Overrides:
toString
in class Object
Copyright (c) 2004-2012 Oracle. All rights reserved.