| |
|
| java.lang.Object java.lang.Thread org.continuent.sequoia.driver.ControllerWatcher
ControllerWatcher | public class ControllerWatcher extends Thread (Code) | | Main class for controller ping monitoring.
Launches a controller pinger thread and creates a list of controllers with
their states. Reads controllers responses (pongs) and updates state
accordingly
author: Gilles Rayrat author: Marc Herbert version: 1.0 |
controllerTimeout | final int controllerTimeout(Code) | | Delay after which a controller will be considered as failing if it did not
respond to pings. Used here as a timeout for select()
|
logLevel | final int logLevel(Code) | | Level of logging (logs are printed to stdout, see
SequoiaUrl )
|
pingDelayInMs | final int pingDelayInMs(Code) | | Time to wait between 2 successive pings to a controller, also used for
select timeout
|
ControllerWatcher | public ControllerWatcher(ControllerInfo[] controllerList, ControllerStateChangedCallback callback, int pingDelayInMs, int controllerTimeout, int logLevel) throws IOException(Code) | | Creates a controller watcher with the given controllers to watch.
Pings will be sent to all given controllers
Parameters: controllerList - controllers to ping Parameters: callback - Callback implementation to call when a controller statechanges Parameters: pingDelayInMs - time to wait between two successive pings Parameters: controllerTimeout - delay after which a controller will be consideredas failing if it did not respond to pings Parameters: logLevel - level of logging to use (logs are printed to stdout) exception: IOException - if the socket selector could not be opened |
getOriginalIndexOf | public int getOriginalIndexOf(ControllerInfo controller)(Code) | | Returns the given controllers index in the original list
Parameters: controller - the controller to get index of original index of the given controller |
restartBothDaemons | void restartBothDaemons()(Code) | | |
run | public void run()(Code) | | Starts watching controllers.
Reads ping responses from controllers and updates corresponding controller
data in the ControllerList .
See Also: java.lang.Thread.run |
terminateBoth | public void terminateBoth()(Code) | | Terminates both pinger and watcher thread TODO: terminateBoth definition.
|
|
|
|