org.neo4j.kernel.ha.zookeeper
Class ZooKeeperClusterClient

java.lang.Object
  extended by org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager
      extended by org.neo4j.kernel.ha.zookeeper.ZooKeeperClusterClient
All Implemented Interfaces:
org.apache.zookeeper.Watcher, ClusterClient

public class ZooKeeperClusterClient
extends AbstractZooKeeperManager
implements ClusterClient


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.zookeeper.Watcher
org.apache.zookeeper.Watcher.Event
 
Field Summary
 
Fields inherited from class org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager
HA_SERVERS_CHILD, NO_MASTER_MACHINE_PAIR
 
Constructor Summary
ZooKeeperClusterClient(String zooKeeperServers)
           
ZooKeeperClusterClient(String zooKeeperServers, AbstractGraphDatabase db)
           
ZooKeeperClusterClient(String zooKeeperServers, String clusterName)
           
ZooKeeperClusterClient(String zooKeeperServers, String clusterName, AbstractGraphDatabase db, long sessionTimeout)
           
 
Method Summary
static String asRootPath(StoreId storeId)
           
 int getBackupPort(int machineId)
           
static StoreId getClusterStoreId(org.apache.zookeeper.ZooKeeper keeper, String clusterName)
           
 Machine[] getConnectedSlaves()
          Returns the connected slaves in this cluster.
 Machine getMaster()
           
 Pair<Master,Machine> getMasterClient()
           
protected  int getMyMachineId()
           
 String getRoot()
           
 org.apache.zookeeper.ZooKeeper getZooKeeper(boolean sync)
           
 void process(org.apache.zookeeper.WatchedEvent event)
           
 void waitForSyncConnected(org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager.WaitMode waitMode)
           
 
Methods inherited from class org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager
bootstrap, getAllMachines, getAllMachines, getCachedMaster, getConnectionLostHandler, getGraphDb, getHaServer, getMasterBasedOn, getMasterClientToMachine, getMasterFromZooKeeper, getServers, getSessionTimeout, instantiateZooKeeper, invalidateMaster, parseChild, readDataRepresentingInstance, readHaServer, shutdown, waitForSyncConnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZooKeeperClusterClient

public ZooKeeperClusterClient(String zooKeeperServers)

ZooKeeperClusterClient

public ZooKeeperClusterClient(String zooKeeperServers,
                              AbstractGraphDatabase db)

ZooKeeperClusterClient

public ZooKeeperClusterClient(String zooKeeperServers,
                              String clusterName)

ZooKeeperClusterClient

public ZooKeeperClusterClient(String zooKeeperServers,
                              String clusterName,
                              AbstractGraphDatabase db,
                              long sessionTimeout)
Method Detail

getMyMachineId

protected int getMyMachineId()
Specified by:
getMyMachineId in class AbstractZooKeeperManager

waitForSyncConnected

public void waitForSyncConnected(org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager.WaitMode waitMode)

getBackupPort

public int getBackupPort(int machineId)
Specified by:
getBackupPort in interface ClusterClient

process

public void process(org.apache.zookeeper.WatchedEvent event)
Specified by:
process in interface org.apache.zookeeper.Watcher

getMaster

public Machine getMaster()
Specified by:
getMaster in interface ClusterClient

getMasterClient

public Pair<Master,Machine> getMasterClient()
Specified by:
getMasterClient in interface ClusterClient

getRoot

public String getRoot()
Specified by:
getRoot in class AbstractZooKeeperManager

asRootPath

public static String asRootPath(StoreId storeId)

getClusterStoreId

public static StoreId getClusterStoreId(org.apache.zookeeper.ZooKeeper keeper,
                                        String clusterName)

getConnectedSlaves

public Machine[] getConnectedSlaves()
Returns the connected slaves in this cluster.

Specified by:
getConnectedSlaves in interface ClusterClient
Returns:
the connected slaves in this cluster.

getZooKeeper

public org.apache.zookeeper.ZooKeeper getZooKeeper(boolean sync)
Specified by:
getZooKeeper in class AbstractZooKeeperManager


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.