com.sleepycat.je.rep.impl.node
Class LocalCBVLSNTracker

java.lang.Object
  extended by com.sleepycat.je.rep.impl.node.LocalCBVLSNTracker

public class LocalCBVLSNTracker
extends Object

The LocalCBVLSNTracker tracks this node's local CBVLSN. Each node has a single tracker instance. The local CBVLSN is maintained by each node. Replicas periodically update the Master with their current CBVLSN via a response to a heartbeat message from the Master, where it is managed by the LocalCBVLSNUpdater and flushed out to RepGroup database, whenever the updater notices that it has changed. The change is then effectively broadcast to all the Replicas including the originating Replica, via the replication stream. For this reason, the CBVLSN for the node as represented in the RepGroup database will generally lag the value contained in the tracker. Note that track() api is invoked in critical code with locks being held and must be lightweight. Local CBVLSNs are used only to contribute to the calculation of the global CBVLSN. The global CBVLSN acts as the cleaner throttle. Any invariants, such as the rule that the cleaner throttle cannot regress, are applied when doing the global calculation.


Constructor Summary
LocalCBVLSNTracker(RepNode repNode)
           
 
Method Summary
 VLSN getBroadcastCBVLSN()
           
 void registerMatchpoint(VLSN matchpoint)
          Initialize the local CBVLSN with the syncup matchpoint, so that the heartbeat responses sent before the node has replayed any log entries are still valid for saving a place in the replication stream.
 void track(VLSN syncableVLSN, long lsn)
          Tracks barrier VLSNs, updating the local CBVLSN if the associated log file has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalCBVLSNTracker

LocalCBVLSNTracker(RepNode repNode)
Method Detail

track

public void track(VLSN syncableVLSN,
                  long lsn)
Tracks barrier VLSNs, updating the local CBVLSN if the associated log file has changed. When tracking is done on a replica, the currentLocalCBVLSN value is ultimately sent via heartbeat response to the master, which updates the RepGroupDb. When tracking is done on a master, the update is done on this node. Tracking can be called quite often, and should be lightweight.

Parameters:
syncableVLSN -
lsn -

registerMatchpoint

public void registerMatchpoint(VLSN matchpoint)
Initialize the local CBVLSN with the syncup matchpoint, so that the heartbeat responses sent before the node has replayed any log entries are still valid for saving a place in the replication stream.

Parameters:
matchpoint -

getBroadcastCBVLSN

public VLSN getBroadcastCBVLSN()
Returns:
the local CBVLSN for broadcast from replica to master on the heartbeat response. Adjustments are made here, so the value broadcast is not literally the current local CBVLSN.


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