org.neo4j.kernel.ha.zookeeper
Class AbstractZooKeeperManager
java.lang.Object
org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager
- All Implemented Interfaces:
- org.apache.zookeeper.Watcher
- Direct Known Subclasses:
- ClusterManager, ZooClient
public abstract class AbstractZooKeeperManager
- extends Object
- implements org.apache.zookeeper.Watcher
Contains basic functionality for a ZooKeeper manager, f.ex. how to get
the current master in the cluster.
| Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher |
org.apache.zookeeper.Watcher.Event |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.zookeeper.Watcher |
process |
HA_SERVERS_CHILD
protected static final String HA_SERVERS_CHILD
- See Also:
- Constant Field Values
SESSION_TIME_OUT
protected static final int SESSION_TIME_OUT
- See Also:
- Constant Field Values
AbstractZooKeeperManager
public AbstractZooKeeperManager(String servers,
AbstractGraphDatabase graphDb,
int clientReadTimeout,
int clientLockReadTimeout,
int maxConcurrentChannelsPerSlave)
instantiateZooKeeper
protected org.apache.zookeeper.ZooKeeper instantiateZooKeeper()
getZooKeeper
public abstract org.apache.zookeeper.ZooKeeper getZooKeeper(boolean sync)
getRoot
public abstract String getRoot()
getGraphDb
protected AbstractGraphDatabase getGraphDb()
parseChild
protected Pair<Integer,Integer> parseChild(String child)
readDataRepresentingInstance
protected Pair<Long,Integer> readDataRepresentingInstance(String path)
throws InterruptedException,
org.apache.zookeeper.KeeperException
- Throws:
InterruptedException
org.apache.zookeeper.KeeperException
invalidateMaster
protected void invalidateMaster()
getMasterFromZooKeeper
protected Pair<Master,Machine> getMasterFromZooKeeper(boolean wait,
boolean allowChange)
getMyMachineId
protected abstract int getMyMachineId()
getCachedMaster
public Pair<Master,Machine> getCachedMaster()
getMasterBasedOn
protected ZooKeeperMachine getMasterBasedOn(Collection<ZooKeeperMachine> machines)
getConnectionLostHandler
protected org.neo4j.com.Client.ConnectionLostHandler getConnectionLostHandler()
getAllMachines
protected Map<Integer,ZooKeeperMachine> getAllMachines(boolean wait)
getHaServer
protected String getHaServer(int machineId,
boolean wait)
readHaServer
protected Pair<String,Integer> readHaServer(int machineId,
boolean wait)
shutdown
public void shutdown()
waitForSyncConnected
public abstract void waitForSyncConnected()
getServers
public String getServers()
Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.