org.neo4j.kernel.ha.zookeeper
Class ZooKeeperBroker

java.lang.Object
  extended by org.neo4j.kernel.ha.AbstractBroker
      extended by org.neo4j.kernel.ha.zookeeper.ZooKeeperBroker
All Implemented Interfaces:
Broker

public class ZooKeeperBroker
extends AbstractBroker


Field Summary
 
Fields inherited from class org.neo4j.kernel.ha.AbstractBroker
config
 
Constructor Summary
ZooKeeperBroker(org.neo4j.kernel.configuration.Config conf, ZooClientFactory zooClientFactory)
           
 
Method Summary
 org.neo4j.helpers.Pair<Master,Machine> bootstrap()
           
 org.neo4j.kernel.impl.nioneo.store.StoreId getClusterStoreId(boolean firstTime)
          Asks the cluster for and returns the storeId currently shared by the cluster members or a new one if none is there.
 ConnectionInformation[] getConnectionInformation()
           
 ConnectionInformation getConnectionInformation(int machineId)
           
 org.neo4j.helpers.Pair<Master,Machine> getMaster()
           
 Machine getMasterExceptMyself()
           
 org.neo4j.helpers.Pair<Master,Machine> getMasterReally(boolean allowChange)
           
protected  ZooClient getZooClient()
           
 boolean iAmMaster()
           
 Object instantiateMasterServer(org.neo4j.kernel.GraphDatabaseAPI graphDb)
           
 void logStatus(org.neo4j.kernel.impl.util.StringLogger msgLog)
           
 void notifyMasterChange(Machine newMaster)
           
 void rebindMaster()
           
 void restart()
           
 void setConnectionInformation(org.neo4j.kernel.KernelData kernel)
           
 void setLastCommittedTxId(long txId)
           
 void shutdown()
           
 void start()
           
 
Methods inherited from class org.neo4j.kernel.ha.AbstractBroker
getConfig, getMyMachineId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZooKeeperBroker

public ZooKeeperBroker(org.neo4j.kernel.configuration.Config conf,
                       ZooClientFactory zooClientFactory)
Method Detail

logStatus

public void logStatus(org.neo4j.kernel.impl.util.StringLogger msgLog)
Specified by:
logStatus in interface Broker
Overrides:
logStatus in class AbstractBroker

getClusterStoreId

public org.neo4j.kernel.impl.nioneo.store.StoreId getClusterStoreId(boolean firstTime)
Description copied from interface: Broker
Asks the cluster for and returns the storeId currently shared by the cluster members or a new one if none is there.

Specified by:
getClusterStoreId in interface Broker
Overrides:
getClusterStoreId in class AbstractBroker
Parameters:
firstTime - False if it should timeout after a session interval passes - expected to be true in the same scenarios where Broker.bootstrap() is called instead of Broker.getMasterReally(boolean)
Returns:
The storeId existing in the cluster or a new one if none is found

setConnectionInformation

public void setConnectionInformation(org.neo4j.kernel.KernelData kernel)
Specified by:
setConnectionInformation in interface Broker
Overrides:
setConnectionInformation in class AbstractBroker

getConnectionInformation

public ConnectionInformation getConnectionInformation(int machineId)
Specified by:
getConnectionInformation in interface Broker
Overrides:
getConnectionInformation in class AbstractBroker

getConnectionInformation

public ConnectionInformation[] getConnectionInformation()
Specified by:
getConnectionInformation in interface Broker
Overrides:
getConnectionInformation in class AbstractBroker

getMaster

public org.neo4j.helpers.Pair<Master,Machine> getMaster()

getMasterReally

public org.neo4j.helpers.Pair<Master,Machine> getMasterReally(boolean allowChange)

getMasterExceptMyself

public Machine getMasterExceptMyself()
Specified by:
getMasterExceptMyself in interface Broker
Overrides:
getMasterExceptMyself in class AbstractBroker

instantiateMasterServer

public Object instantiateMasterServer(org.neo4j.kernel.GraphDatabaseAPI graphDb)

setLastCommittedTxId

public void setLastCommittedTxId(long txId)
Specified by:
setLastCommittedTxId in interface Broker
Overrides:
setLastCommittedTxId in class AbstractBroker

iAmMaster

public boolean iAmMaster()

start

public void start()
Specified by:
start in interface Broker
Overrides:
start in class AbstractBroker

shutdown

public void shutdown()
Specified by:
shutdown in interface Broker
Overrides:
shutdown in class AbstractBroker

restart

public void restart()
Specified by:
restart in interface Broker
Overrides:
restart in class AbstractBroker

rebindMaster

public void rebindMaster()
Specified by:
rebindMaster in interface Broker
Overrides:
rebindMaster in class AbstractBroker

notifyMasterChange

public void notifyMasterChange(Machine newMaster)
Specified by:
notifyMasterChange in interface Broker
Overrides:
notifyMasterChange in class AbstractBroker

getZooClient

protected ZooClient getZooClient()

bootstrap

public org.neo4j.helpers.Pair<Master,Machine> bootstrap()
Specified by:
bootstrap in interface Broker
Overrides:
bootstrap in class AbstractBroker


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