org.neo4j.kernel.ha.zookeeper
Class ZooClient

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

public class ZooClient
extends AbstractZooKeeperManager


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
ZooClient(AbstractGraphDatabase graphDb, Map<String,String> config, ResponseReceiver receiver)
           
 
Method Summary
protected  void flushUnprocessedEvents(org.apache.zookeeper.ZooKeeper zooKeeper)
          Flush all events we go before initialization of ZooKeeper/WatcherImpl was completed.
 StoreId getClusterStoreId(org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager.WaitMode waitMode)
           
protected  Client.ConnectionLostHandler getConnectionLostHandler()
           
protected  String getHaServer(int machineId, boolean wait)
           
 void getJmxConnectionData(ConnectionInformation connection)
           
protected  int getMyMachineId()
           
 String getRoot()
           
 org.apache.zookeeper.ZooKeeper getZooKeeper(boolean sync)
           
 boolean isShutdown()
           
 void process(org.apache.zookeeper.WatchedEvent event)
           
 void setCommittedTx(long tx)
           
protected  void setDataChangeWatcher(String child, int currentMasterId)
           
 void setJmxConnectionData(JMXServiceURL jmxUrl, String instanceId)
           
 void shutdown()
           
protected  void subscribeToDataChangeWatcher(String child)
           
 String toString()
           
 void waitForSyncConnected(org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager.WaitMode mode)
           
 
Methods inherited from class org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager
bootstrap, getAllMachines, getAllMachines, getCachedMaster, getGraphDb, getMasterBasedOn, getMasterClientToMachine, getMasterFromZooKeeper, getServers, getSessionTimeout, instantiateZooKeeper, invalidateMaster, parseChild, readDataRepresentingInstance, readHaServer, waitForSyncConnected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ZooClient

public ZooClient(AbstractGraphDatabase graphDb,
                 Map<String,String> config,
                 ResponseReceiver receiver)
Method Detail

flushUnprocessedEvents

protected void flushUnprocessedEvents(org.apache.zookeeper.ZooKeeper zooKeeper)
Flush all events we go before initialization of ZooKeeper/WatcherImpl was completed.

Parameters:
zooKeeper - ZooKeeper instance to use when processing. We cannot rely on the zooKeeper instance inherited from ZooClient since the contract says that such fields are only guaranteed to be published when the constructor has returned, and at this point it hasn't.

getMyMachineId

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

getConnectionLostHandler

protected Client.ConnectionLostHandler getConnectionLostHandler()
Overrides:
getConnectionLostHandler in class AbstractZooKeeperManager

process

public void process(org.apache.zookeeper.WatchedEvent event)

waitForSyncConnected

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

subscribeToDataChangeWatcher

protected void subscribeToDataChangeWatcher(String child)

setDataChangeWatcher

protected void setDataChangeWatcher(String child,
                                    int currentMasterId)

getRoot

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

setJmxConnectionData

public void setJmxConnectionData(JMXServiceURL jmxUrl,
                                 String instanceId)

getJmxConnectionData

public void getJmxConnectionData(ConnectionInformation connection)

setCommittedTx

public void setCommittedTx(long tx)

shutdown

public void shutdown()
Overrides:
shutdown in class AbstractZooKeeperManager

isShutdown

public boolean isShutdown()

getZooKeeper

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

getHaServer

protected String getHaServer(int machineId,
                             boolean wait)
Overrides:
getHaServer in class AbstractZooKeeperManager

getClusterStoreId

public StoreId getClusterStoreId(org.neo4j.kernel.ha.zookeeper.AbstractZooKeeperManager.WaitMode waitMode)

toString

public String toString()
Overrides:
toString in class Object


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