|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.rep.impl.node.CommitFreezeLatch
public class CommitFreezeLatch
Ensures that a VLSN is not advanced at this node while an election is in progress. Note that this is difficult, if not impossible to achieve efficiently in a distributed environment across the entire group, when communications may not always be reliable. So, the implementation really represents a good faith effort to freeze the VLSN. JE HA itself should be able to make forward progress in the event of such a failure. The class coordinates three threads: the acceptor, the learner, and the replay thread. There is exactly one instance of each thread per replication node, so it coordinates the activity of these three threads. The typical serialized sequence of calls is therefore: latch.freeze() -- invoked in response to a Promise by an Acceptor latch.vlsnEvent() -- one or more of them in response to ongoing election latch.awaitThaw() -- by the replica thread waiting for the freeze to lift Both vlsnEvent() and awaitThaw() are NOPs in the absence of a freeze.
Constructor Summary | |
---|---|
CommitFreezeLatch()
|
Method Summary | |
---|---|
boolean |
awaitThaw()
Used to wait for an event that unfreezes the VLSN. |
void |
clearLatch()
Clears the latch freeing any waiters. |
void |
freeze(Proposer.Proposal freezeProposal)
Initiates or extends a freeze on a VLSN in response to a new election that is in progress. |
int |
getAwaitElectionCount()
|
int |
getAwaitTimeoutCount()
|
int |
getFreezeCount()
|
long |
getTimeOut()
|
void |
setTimeOut(long timeOut)
|
void |
vlsnEvent(Proposer.Proposal listenerProposal)
Invoked by the Learner thread whenever it receives an election result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommitFreezeLatch()
Method Detail |
---|
public int getAwaitTimeoutCount()
public int getAwaitElectionCount()
public int getFreezeCount()
public long getTimeOut()
public void setTimeOut(long timeOut)
public void freeze(Proposer.Proposal freezeProposal)
freezeProposal
- identifies the election that is provoking the freezepublic void vlsnEvent(Proposer.Proposal listenerProposal)
listenerProposal
- identifies the election that just concludedpublic void clearLatch()
public boolean awaitThaw() throws InterruptedException
InterruptedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |