public abstract class FailoverClusterPaths extends Object
ClusterPaths
used by the cluster manager. The intention of this class is to
add failover related cluster paths to the ZooKeeper ensemble.Modifier and Type | Field and Description |
---|---|
protected ClusterPaths |
clusterPaths
Cluster paths used by the cluster manager
|
protected String |
failoverZNodePath
The ZNode path where all the failover related ZNodes will be created under.
|
protected String |
failoverZNodeRoot |
protected String |
strategiesZNodePath
The ZNode path where each of the failover strategies will be implemented under.
|
protected String |
strategiesZNodeRoot |
protected String |
strategyZNodePath
The base path of the ZNodes related to this strategy.
|
protected String |
strategyZNodeRoot |
Constructor and Description |
---|
FailoverClusterPaths() |
Modifier and Type | Method and Description |
---|---|
void |
clearAll(org.apache.curator.framework.CuratorFramework client)
Clear the ZNodes (specially the ephemeral nodes) responsible for failover handling of this node.
|
protected abstract void |
clearAllClusterPaths(org.apache.curator.framework.CuratorFramework client)
Clears all cluster paths
|
void |
createAll(org.apache.curator.framework.CuratorFramework client)
Creates all the cluster paths required for the failover processing.
|
protected abstract void |
createAllClusterPaths(org.apache.curator.framework.CuratorFramework client)
Creates all cluster paths
|
abstract void |
createAllEphemeralNodes(org.apache.curator.framework.CuratorFramework client)
This method will be called whenever a connection reconnection happens.
|
abstract String |
getClusterLockZNodePathSuffix(String entityName)
Get the path, on which a cluster lock to be taken whenever a distributed lock has to be acquired to start failover.
|
ClusterPaths |
getClusterPaths() |
String |
getFailoverZNodePath() |
String |
getFailoverZNodeRoot() |
String |
getStrategiesZNodePath() |
String |
getStrategiesZNodeRoot() |
abstract String |
getStrategyName()
Get the name of the strategy to which this cluster path pattern is binded to
|
String |
getStrategyZNodePath() |
String |
getStrategyZNodeRoot() |
void |
initialize(ClusterPaths clusterPaths)
Initializes the failover related cluster paths by generating the ZNode path names
|
protected abstract void |
initializeClusterPaths()
Initializes the cluster paths
|
protected ClusterPaths clusterPaths
protected String failoverZNodePath
protected String failoverZNodeRoot
protected String strategiesZNodePath
protected String strategiesZNodeRoot
protected String strategyZNodePath
protected String strategyZNodeRoot
public void initialize(ClusterPaths clusterPaths)
clusterPaths
- ClusterPaths
instance of this node's cluster managerpublic void createAll(org.apache.curator.framework.CuratorFramework client)
createAllClusterPaths(CuratorFramework)
to create all the ZNode paths required by the child classesclient
- CuratorFramework
instancepublic void clearAll(org.apache.curator.framework.CuratorFramework client)
client
- CuratorFramework
instanceprotected abstract void initializeClusterPaths()
initialize(ClusterPaths)
protected abstract void createAllClusterPaths(org.apache.curator.framework.CuratorFramework client)
client
- the curator framework to be used for creationcreateAll(CuratorFramework)
protected abstract void clearAllClusterPaths(org.apache.curator.framework.CuratorFramework client)
client
- the curator framework to be used for clearingclearAll(CuratorFramework)
public abstract void createAllEphemeralNodes(org.apache.curator.framework.CuratorFramework client)
client
- CuratorFramework
instancepublic abstract String getClusterLockZNodePathSuffix(String entityName)
entityName
- the name of the node, group etc.public abstract String getStrategyName()
public ClusterPaths getClusterPaths()
public String getFailoverZNodePath()
public String getFailoverZNodeRoot()
public String getStrategiesZNodePath()
public String getStrategiesZNodeRoot()
public String getStrategyZNodePath()
public String getStrategyZNodeRoot()
Copyright © 2016–2019 AdroitLogic. All rights reserved.