| java.lang.Object org.continuent.sequoia.driver.connectpolicy.AbstractControllerConnectPolicy
All known Subclasses: org.continuent.sequoia.driver.connectpolicy.PreferredListConnectPolicy, org.continuent.sequoia.driver.connectpolicy.OrderedConnectPolicy, org.continuent.sequoia.driver.connectpolicy.RoundRobinConnectPolicy, org.continuent.sequoia.driver.connectpolicy.SingleConnectPolicy, org.continuent.sequoia.driver.connectpolicy.RandomConnectPolicy,
AbstractControllerConnectPolicy | abstract public class AbstractControllerConnectPolicy (Code) | | This class defines an AbstractControllerConnectPolicy used by the driver to
choose a controller to connect to.
author: Emmanuel Cecchet author: version: 1.0 |
Inner Class :protected class ControllerAndVdbState | |
aliveControllers | protected ArrayList aliveControllers(Code) | | Up-to-date list of controllers that respond to pings with associated
lastVdbFailure time stamp
|
debugLevel | protected int debugLevel(Code) | | Level of logging (will be done on stdout)
|
AbstractControllerConnectPolicy | public AbstractControllerConnectPolicy(ControllerInfo[] controllerList, int pingDelayInMs, int controllerTimeoutInMs, int debugLevel)(Code) | | Creates a new AbstractControllerConnectPolicy object
Parameters: controllerList - the controller list on which the policy applies Parameters: pingDelayInMs - Interval in milliseconds between two pings of acontroller Parameters: controllerTimeoutInMs - timeout in milliseconds after which acontroller is considered as dead if it did not respond to pings Parameters: debugLevel - the debug level to use See Also: org.continuent.sequoia.driver.SequoiaUrl.DEBUG_LEVEL_OFF |
controllerDown | public synchronized void controllerDown(ControllerInfo controller)(Code) | | Removes this controller from the list of alive ones. Warning: This
function should never be called directly, only the callback should make us
of this.
Parameters: controller - the suspect controller |
controllerUp | public synchronized void controllerUp(ControllerInfo controller)(Code) | | Adds the specified controller to the list of alive ones at the specified
position. Warning: This function should never be called directly,
only the callback should make us of this.
Parameters: controller - the controller that came back Parameters: index - the index to put the controller back at |
forceControllerDown | public synchronized void forceControllerDown(ControllerInfo controller)(Code) | | Tell the watcher that a failure has been detected on the given controller.
This function should be called when a connection error occurs on the given
controller. We don't update the aliveController list here: the watcher
callback will call controllerDown() for us
Parameters: controller - the controller suspected of failure |
getControllerByNum | protected synchronized ControllerInfo getControllerByNum(int wishedIndex) throws NoMoreControllerException(Code) | | Returns the first controller that is alive and with a running vdb starting
at rank wishedIndex in the list. wishedIndex = 0 will return the first
alive controller. If the wishedIndex controller's vdb at is not available,
will return the next controller in a round robin way, until finding one
suitable. If no suitable controller can be found, throws a
NoMoreControllerException
Parameters: wishedIndex - index of the controller in the list a controller that is alive with its vdb up throws: NoMoreControllerException - if no controller with vdb up could befound |
isVdbUpOnController | protected synchronized boolean isVdbUpOnController(ControllerInfo controller)(Code) | | Tells if the given controller VDB is available.
false if the lastVdbFailure associated to the given controller isnot older than ??? milliseconds, true otherwise |
numberOfAliveControllers | public synchronized int numberOfAliveControllers()(Code) | | Returns the number of controllers still known to be alive
|
registerSocket | public synchronized void registerSocket(ControllerInfo controller, Socket socket)(Code) | | Registers the given socket to the callback so it can kill this socket when
the controller is detected as failed
Parameters: controller - the controller to which the socket is connected Parameters: socket - the socket to register |
setVdbDownOnController | public synchronized void setVdbDownOnController(ControllerInfo controller)(Code) | | Informs that the given controller's vdb is no more available
|
|
|