com.sleepycat.je.rep.impl.node
Class Replica.ConsistencyTracker

java.lang.Object
  extended by com.sleepycat.je.rep.impl.node.Replica.ConsistencyTracker
Enclosing class:
Replica

public class Replica.ConsistencyTracker
extends Object

Tracks the consistency of this replica wrt the Master. It provides the mechanisms that will cause a beginTransaction() or a joinGroup() to wait until the specified consistency policy is satisfied.


Constructor Summary
Replica.ConsistencyTracker()
           
 
Method Summary
 void awaitVLSN(long vlsn, ReplicaConsistencyPolicy consistencyPolicy)
          Wait until the log record identified by VLSN has gone by.
(package private)  void close()
           
(package private)  void forceTripLatches(DatabaseException exception)
          Frees all the threads that are waiting on latches.
 long getMasterTxnEndVLSN()
           
 void lagAwait(TimeConsistencyPolicy consistencyPolicy)
           
(package private)  void logStats()
           
(package private)  void reinit(long matchedTxnVLSN, long matchedTxnEndTime)
          Invoked each time after a replica syncup so that the Replica can re-establish it's consistency vis a vis the master and what part of the replication stream it considers as having been replayed.
 void shutdown()
          Shutdown the consistency tracker.
(package private)  void trackHeartbeat(Protocol.Heartbeat heartbeat)
           
(package private)  void trackTxnEnd()
           
(package private)  void trackVLSN()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Replica.ConsistencyTracker

public Replica.ConsistencyTracker()
Method Detail

reinit

void reinit(long matchedTxnVLSN,
            long matchedTxnEndTime)
Invoked each time after a replica syncup so that the Replica can re-establish it's consistency vis a vis the master and what part of the replication stream it considers as having been replayed.

Parameters:
matchedTxnVLSN - the replica state corresponds to this txn
matchedTxnEndTime - the time at which this txn was committed or aborted on the master

getMasterTxnEndVLSN

public long getMasterTxnEndVLSN()

close

void close()

logStats

void logStats()

forceTripLatches

void forceTripLatches(DatabaseException exception)
Frees all the threads that are waiting on latches.

Parameters:
exception - the exception to be thrown to explain the reason behind the latches being forced.

trackTxnEnd

void trackTxnEnd()

trackVLSN

void trackVLSN()

trackHeartbeat

void trackHeartbeat(Protocol.Heartbeat heartbeat)

lagAwait

public void lagAwait(TimeConsistencyPolicy consistencyPolicy)
              throws InterruptedException,
                     ReplicaConsistencyException,
                     DatabaseException
Throws:
InterruptedException
ReplicaConsistencyException
DatabaseException

awaitVLSN

public void awaitVLSN(long vlsn,
                      ReplicaConsistencyPolicy consistencyPolicy)
               throws InterruptedException,
                      ReplicaConsistencyException,
                      DatabaseException
Wait until the log record identified by VLSN has gone by.

Throws:
InterruptedException
ReplicaConsistencyException
DatabaseException

shutdown

public void shutdown()
Shutdown the consistency tracker. This is typically done as part of the shutdown of a replication node. It counts down all open latches, so the threads waiting on them can make progress. It's the responsibility of the waiting threads to check whether the latch countdown was due to a shutdown, and take appropriate action.



Copyright (c) 2004-2012 Oracle. All rights reserved.