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

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

 class JoinGroupTimeouts
extends Object

Encapsulates the handling of timeouts: ENV_SETUP_TIMEOUT and ENV_UNKNOWN_STATE_TIMEOUT, used when a replicated environment handle is opened and a node joins the group.

There are three timeouts that are relevant at the time a Replica joins a group. They are listed below in the order in which each is applied. 1) The ENV_UNKNOWN_STATE_TIMEOUT which is basically an election timeout. If set and an election is not concluded in this time period, the environment handle is opened in the unknown state. 2) The ENV_SETUP_TIMEOUT. This timeout determines the maximum amount of time allowed to hold an election and sync up with a master if the joins as a replica. 3) The consistency timeout as determined by the consistency policy in the event that the node joins as a replica. The first two timeouts are managed by this class. RepNode.joinGroup uses the timeouts supplied by the getTimeout() method to wait for each timeout if both are specified. joinGroup first waits up to the unknown state timeout for an election to be concluded. If the node is not in the unknown state at the timeout, it advances to the env setup timeout by invoking setSetupTimeout() and proceeds to wait up to this timeout for the syncup activity to complete.


Constructor Summary
JoinGroupTimeouts(DbConfigManager configManager)
           
 
Method Summary
 int getSetupTimeout()
          Returns the setup timeout
(package private)  int getTimeout()
          Returns the currently active timeout, adjusted for the time that has already elapsed.
(package private)  void setSetupTimeout()
          Set the currently active timeout to be the env setup timeout.
(package private)  boolean timeoutIsForUnknownState()
          Returns true if the currently active timeout is the one for the transition out of the unknown state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoinGroupTimeouts

JoinGroupTimeouts(DbConfigManager configManager)
Method Detail

getTimeout

int getTimeout()
Returns the currently active timeout, adjusted for the time that has already elapsed.


getSetupTimeout

public int getSetupTimeout()
Returns the setup timeout


timeoutIsForUnknownState

boolean timeoutIsForUnknownState()
Returns true if the currently active timeout is the one for the transition out of the unknown state.


setSetupTimeout

void setSetupTimeout()
Set the currently active timeout to be the env setup timeout.



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