public class NodeWiseFailoverStrategy extends FailoverStrategy<NodeWiseFailoverClusterPaths>
Class implementing the Node wise failover strategy. This class has the ability to failover node wise. That is, once configured this class will watch on the assigned nodes for their activeness and whenever an inactivity is detected, this class will take the corresponding measures to notify to as the assigned node.
recursivelyFailover
flag is used to state whether to provide failover recursively when a node goes down.
Therefore, this flag has to be used carefully. When configuring nodes, we have to make sure that the projects
required to provide recursive failover is added to each node.
client, environment, failoverClusterPaths, logger, status
Constructor and Description |
---|
NodeWiseFailoverStrategy() |
Modifier and Type | Method and Description |
---|---|
int |
getDistributedLockWaitTimeMs() |
Map<String,List<String>> |
getFailoverMatrix() |
int |
getWaitTimeBeforeFailoverMs() |
protected void |
initStrategy() |
boolean |
isFailoverOnStartup() |
boolean |
isRecursivelyFailover() |
protected NodeWiseFailoverClusterPaths |
newFailoverClusterPaths() |
void |
refresh()
This method is called whenever the failover strategy believes that the connection state became unstable and again
re became stable.
|
void |
resetTags()
Whenever the connection state changes to lost or suspended, this method will be called in order to remove the tags
added by the extending concrete strategy.
|
void |
setDistributedLockWaitTimeMs(int distributedLockWaitTimeMs) |
void |
setFailoverMatrix(Map<String,String> failoverMatrix) |
void |
setFailoverOnStartup(boolean failoverOnStartup) |
void |
setRecursivelyFailover(boolean recursivelyFailover) |
void |
setWaitTimeBeforeFailoverMs(int waitTimeBeforeFailoverMs) |
protected void |
startStrategy() |
protected void |
stopStrategy() |
String |
toString() |
addTags, getFailoverClusterPaths, initialize, removeTags, start, stateChanged, stop
protected void initStrategy()
initStrategy
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
protected void startStrategy()
startStrategy
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
public void refresh()
refresh
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
public void resetTags()
resetTags
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
protected void stopStrategy()
stopStrategy
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
public Map<String,List<String>> getFailoverMatrix()
getFailoverMatrix
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
public String toString()
toString
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
protected NodeWiseFailoverClusterPaths newFailoverClusterPaths()
newFailoverClusterPaths
in class FailoverStrategy<NodeWiseFailoverClusterPaths>
public int getDistributedLockWaitTimeMs()
public void setDistributedLockWaitTimeMs(int distributedLockWaitTimeMs)
public int getWaitTimeBeforeFailoverMs()
public void setWaitTimeBeforeFailoverMs(int waitTimeBeforeFailoverMs)
public boolean isFailoverOnStartup()
public void setFailoverOnStartup(boolean failoverOnStartup)
public boolean isRecursivelyFailover()
public void setRecursivelyFailover(boolean recursivelyFailover)
Copyright © 2016–2019 AdroitLogic. All rights reserved.