|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.impl.node.LocalCBVLSNUpdater
public class LocalCBVLSNUpdater
Supports updating the group database with each node's local CBVLSN when it is in the Master state. There is one instance per feeder connection, plus one for the Master. There is, logically, a LocalCBVLSNTracker instance associated with each instance of the updater. The instance is local for an update associated with a node in the Master state and is remote for each Replica. The nodeCBVLSN can only increase during the lifetime of the LocalCBVLSNUpdater instance. Note however that the value of the node's CBVLSN as stored in the database, which represents the values from multiple updaters associated, with a node over its lifetime may both decrease and increase over its lifetime. The decreases are due primarily to rollbacks, and should be relatively rare. The updaters used to maintain the Replica's local CBVLSNs are stored in the Feeder.InputThread. The lifetime of such a LocalCBVLSNUpdater is therefore determined by the lifetime of the connection between the Master and the Replica. The node CBVLSN is updated each time a heart beat response is processed by the FeederInput thread. It's also updated when the Master detects that a Replica needs a network restore. In this case, it updates cbvlsn to the value expected from the node after a network restore so that the global CBVLSN can continue to make forward progress and not hold up the cleaner. The Master maintains an updater for its own CBVLSN in the FeederManager. This updater exists as long as the node retains its Master state. 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 | |
---|---|
LocalCBVLSNUpdater(NameIdPair nameIdPair,
RepNode repNode)
|
Method Summary | |
---|---|
(package private) void |
doUpdate(VLSN vlsn,
String source)
|
(package private) static boolean |
getSuppressGroupDBUpdates()
|
static void |
setSuppressGroupDBUpdates(boolean suppressGroupDBUpdates)
Used during testing to suppress CBVLSN updates at this node. |
void |
update()
Update the database, with the local CBVLSN associated with the node ID if required. |
(package private) void |
updateForMaster(LocalCBVLSNTracker tracker)
As a master, update the database with the local CBVLSN for this node. |
void |
updateForReplica(Protocol.HeartbeatResponse heartbeat)
Sets the current CBVLSN for this node. |
void |
updateForReplica(VLSN syncableVLSN)
Exercise caution when using this method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
LocalCBVLSNUpdater(NameIdPair nameIdPair, RepNode repNode)
Method Detail |
---|
public void updateForReplica(VLSN syncableVLSN)
updateForReplica(com.sleepycat.je.rep.stream.Protocol.HeartbeatResponse)
. The two methods together, must maintain the invariant that the local
CBVLSN value must always be ascending.
syncableVLSN
- the new local CBVLSNpublic void updateForReplica(Protocol.HeartbeatResponse heartbeat)
heartbeat
- The incoming heartbeat response message from the
replica containing its newest local cbvlsn.void updateForMaster(LocalCBVLSNTracker tracker)
void doUpdate(VLSN vlsn, String source)
public void update()
public static void setSuppressGroupDBUpdates(boolean suppressGroupDBUpdates)
suppressGroupDBUpdates
- If true, the group DB and the group CBVLSN
won't be updated at the master.static boolean getSuppressGroupDBUpdates()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |