Neo4j Enterprise

org.neo4j.kernel
Class HighlyAvailableGraphDatabase

java.lang.Object
  extended by org.neo4j.kernel.AbstractGraphDatabase
      extended by org.neo4j.kernel.HighlyAvailableGraphDatabase
All Implemented Interfaces:
GraphDatabaseService, GraphDatabaseAPI

public class HighlyAvailableGraphDatabase
extends AbstractGraphDatabase
implements GraphDatabaseService, GraphDatabaseAPI


Nested Class Summary
static class HighlyAvailableGraphDatabase.BranchedDataPolicy
           
 
Field Summary
protected  Config configuration
           
static String COPY_FROM_MASTER_TEMP
           
protected  org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction fileSystemAbstraction
           
protected  Logging logging
           
static String NOT_ALLOWED_TO_JOIN_CLUSTER_WITH_EMPTY_STORE
           
protected  org.neo4j.kernel.impl.nioneo.store.StoreId storeId
           
 
Constructor Summary
HighlyAvailableGraphDatabase(String storeDir, Map<String,String> config)
          Default IndexProviders and KernelExtensions by calling Service.load
HighlyAvailableGraphDatabase(String storeDir, Map<String,String> config, Iterable<IndexProvider> indexProviders, Iterable<KernelExtension> kernelExtensions, Iterable<org.neo4j.kernel.impl.cache.CacheProvider> cacheProviders)
          Create a new instance of HighlyAvailableGraphDatabase
 
Method Summary
 Transaction beginTx()
          Starts a new transaction and associates it with the current thread.
protected  void close()
           
protected  org.neo4j.kernel.ha.Broker createBroker()
           
protected  ClusterChecker createClusterChecker()
           
protected  org.neo4j.kernel.ha.ClusterClient createClusterClient()
           
 Node createNode()
          Creates a new node.
 Iterable<Node> getAllNodes()
          Returns all nodes in the graph.
 org.neo4j.kernel.ha.Broker getBroker()
           
 DependencyResolver getDependencyResolver()
           
 DiagnosticsManager getDiagnosticsManager()
           
 Guard getGuard()
           
 IdGeneratorFactory getIdGeneratorFactory()
           
 KernelData getKernelData()
           
 org.neo4j.kernel.impl.core.KernelPanicEventGenerator getKernelPanicGenerator()
           
 org.neo4j.kernel.impl.transaction.LockManager getLockManager()
           
 org.neo4j.kernel.impl.core.LockReleaser getLockReleaser()
           
protected  int getMachineId()
           
<T> T
getManagementBean(Class<T> type)
          Get a single management bean.
<T> Collection<T>
getManagementBeans(Class<T> type)
           
 org.neo4j.kernel.ha.MasterServer getMasterServerIfMaster()
           
 org.neo4j.kernel.impl.util.StringLogger getMessageLog()
           
 Node getNodeById(long id)
          Looks up a node by id.
 org.neo4j.kernel.impl.core.NodeManager getNodeManager()
           
 org.neo4j.kernel.impl.persistence.PersistenceSource getPersistenceSource()
           
 Node getReferenceNode()
          Returns the reference node, which is a "starting point" in the node space.
 Relationship getRelationshipById(long id)
          Looks up a relationship by id.
 org.neo4j.kernel.impl.core.RelationshipTypeHolder getRelationshipTypeHolder()
           
 Iterable<RelationshipType> getRelationshipTypes()
          Returns all relationship types currently in the underlying store.
<T> T
getSingleManagementBean(Class<T> type)
           
 String getStoreDir()
           
 org.neo4j.kernel.impl.nioneo.store.StoreId getStoreId()
           
 org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator getTxIdGenerator()
           
 TransactionManager getTxManager()
           
 org.neo4j.kernel.impl.transaction.XaDataSourceManager getXaDataSourceManager()
           
 IndexManager index()
          Returns the IndexManager paired with this graph database service and is the entry point for managing indexes coupled with this database.
 void internalShutdown(boolean rotateLogs)
           
 boolean isMaster()
           
 void pullUpdates()
           
protected  void reevaluateMyself()
           
 KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
          Registers handler as a handler for kernel events which are generated from different places in the lifecycle of the kernel.
<T> TransactionEventHandler<T>
registerTransactionEventHandler(TransactionEventHandler<T> handler)
          Registers handler as a handler for transaction events which are generated from different places in the lifecycle of each transaction.
 void shutdown()
          Shuts down Neo4j.
protected  void start()
           
protected  InternalAbstractGraphDatabase startAsMaster()
           
 String toString()
           
 boolean transactionRunning()
           
 TransactionBuilder tx()
           
 KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
          Unregisters handler from the list of kernel event handlers.
<T> TransactionEventHandler<T>
unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
          Unregisters handler from the list of transaction event handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NOT_ALLOWED_TO_JOIN_CLUSTER_WITH_EMPTY_STORE

public static final String NOT_ALLOWED_TO_JOIN_CLUSTER_WITH_EMPTY_STORE
See Also:
Constant Field Values

COPY_FROM_MASTER_TEMP

public static final String COPY_FROM_MASTER_TEMP
See Also:
Constant Field Values

storeId

protected volatile org.neo4j.kernel.impl.nioneo.store.StoreId storeId

logging

protected Logging logging

configuration

protected Config configuration

fileSystemAbstraction

protected final org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction fileSystemAbstraction
Constructor Detail

HighlyAvailableGraphDatabase

public HighlyAvailableGraphDatabase(String storeDir,
                                    Map<String,String> config)
Default IndexProviders and KernelExtensions by calling Service.load

Parameters:
storeDir -
config -

HighlyAvailableGraphDatabase

public HighlyAvailableGraphDatabase(String storeDir,
                                    Map<String,String> config,
                                    Iterable<IndexProvider> indexProviders,
                                    Iterable<KernelExtension> kernelExtensions,
                                    Iterable<org.neo4j.kernel.impl.cache.CacheProvider> cacheProviders)
Create a new instance of HighlyAvailableGraphDatabase

Method Detail

createClusterChecker

protected ClusterChecker createClusterChecker()

createNode

public Node createNode()
Description copied from interface: GraphDatabaseService
Creates a new node.

Specified by:
createNode in interface GraphDatabaseService
Returns:
the created node.

getNodeById

public Node getNodeById(long id)
Description copied from interface: GraphDatabaseService
Looks up a node by id.

Specified by:
getNodeById in interface GraphDatabaseService
Parameters:
id - the id of the node
Returns:
the node with id id if found

getReferenceNode

public Node getReferenceNode()
Description copied from interface: GraphDatabaseService
Returns the reference node, which is a "starting point" in the node space. Usually, a client attaches relationships to this node that leads into various parts of the node space. For more information about common node space organizational patterns, see the design guide at wiki.neo4j.org/content/Design_Guide.

Specified by:
getReferenceNode in interface GraphDatabaseService
Returns:
the reference node

getAllNodes

public Iterable<Node> getAllNodes()
Description copied from interface: GraphDatabaseService
Returns all nodes in the graph.

Specified by:
getAllNodes in interface GraphDatabaseService
Returns:
all nodes in the graph.

getRelationshipTypes

public Iterable<RelationshipType> getRelationshipTypes()
Description copied from interface: GraphDatabaseService
Returns all relationship types currently in the underlying store. Relationship types are added to the underlying store the first time they are used in a successfully commited node.createRelationshipTo(...). Note that this method is guaranteed to return all known relationship types, but it does not guarantee that it won't return more than that (e.g. it can return "historic" relationship types that no longer have any relationships in the node space).

Specified by:
getRelationshipTypes in interface GraphDatabaseService
Returns:
all relationship types in the underlying store

getRelationshipById

public Relationship getRelationshipById(long id)
Description copied from interface: GraphDatabaseService
Looks up a relationship by id.

Specified by:
getRelationshipById in interface GraphDatabaseService
Parameters:
id - the id of the relationship
Returns:
the relationship with id id if found

index

public IndexManager index()
Description copied from interface: GraphDatabaseService
Returns the IndexManager paired with this graph database service and is the entry point for managing indexes coupled with this database.

Specified by:
index in interface GraphDatabaseService
Returns:
the IndexManager for this database.

beginTx

public Transaction beginTx()
Description copied from interface: GraphDatabaseService
Starts a new transaction and associates it with the current thread.

Specified by:
beginTx in interface GraphDatabaseService
Returns:
a new transaction instance

shutdown

public void shutdown()
Description copied from interface: GraphDatabaseService
Shuts down Neo4j. After this method has been invoked, it's invalid to invoke any methods in the Neo4j API and all references to this instance of GraphDatabaseService should be discarded.

Specified by:
shutdown in interface GraphDatabaseService

getNodeManager

public org.neo4j.kernel.impl.core.NodeManager getNodeManager()
Specified by:
getNodeManager in interface GraphDatabaseAPI

getLockReleaser

public org.neo4j.kernel.impl.core.LockReleaser getLockReleaser()
Specified by:
getLockReleaser in interface GraphDatabaseAPI

getLockManager

public org.neo4j.kernel.impl.transaction.LockManager getLockManager()
Specified by:
getLockManager in interface GraphDatabaseAPI

getXaDataSourceManager

public org.neo4j.kernel.impl.transaction.XaDataSourceManager getXaDataSourceManager()
Specified by:
getXaDataSourceManager in interface GraphDatabaseAPI

getTxManager

public TransactionManager getTxManager()
Specified by:
getTxManager in interface GraphDatabaseAPI

getDiagnosticsManager

public DiagnosticsManager getDiagnosticsManager()
Specified by:
getDiagnosticsManager in interface GraphDatabaseAPI

getMessageLog

public org.neo4j.kernel.impl.util.StringLogger getMessageLog()
Specified by:
getMessageLog in interface GraphDatabaseAPI

getRelationshipTypeHolder

public org.neo4j.kernel.impl.core.RelationshipTypeHolder getRelationshipTypeHolder()
Specified by:
getRelationshipTypeHolder in interface GraphDatabaseAPI

getIdGeneratorFactory

public IdGeneratorFactory getIdGeneratorFactory()
Specified by:
getIdGeneratorFactory in interface GraphDatabaseAPI

getTxIdGenerator

public org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator getTxIdGenerator()
Specified by:
getTxIdGenerator in interface GraphDatabaseAPI

getKernelData

public KernelData getKernelData()
Specified by:
getKernelData in interface GraphDatabaseAPI

getSingleManagementBean

public <T> T getSingleManagementBean(Class<T> type)
Specified by:
getSingleManagementBean in interface GraphDatabaseAPI

start

protected void start()

getBroker

public org.neo4j.kernel.ha.Broker getBroker()

pullUpdates

public void pullUpdates()

getManagementBeans

public <T> Collection<T> getManagementBeans(Class<T> type)
Specified by:
getManagementBeans in interface GraphDatabaseAPI

transactionRunning

public boolean transactionRunning()
Specified by:
transactionRunning in class AbstractGraphDatabase

getManagementBean

public final <T> T getManagementBean(Class<T> type)
Description copied from class: AbstractGraphDatabase
Get a single management bean. Delegates to GraphDatabaseAPI.getSingleManagementBean(Class).

Specified by:
getManagementBean in class AbstractGraphDatabase

toString

public String toString()
Overrides:
toString in class Object

reevaluateMyself

protected void reevaluateMyself()

startAsMaster

protected InternalAbstractGraphDatabase startAsMaster()

tx

public TransactionBuilder tx()
Specified by:
tx in interface GraphDatabaseAPI

internalShutdown

public void internalShutdown(boolean rotateLogs)

close

protected void close()

registerKernelEventHandler

public KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
Description copied from interface: GraphDatabaseService
Registers handler as a handler for kernel events which are generated from different places in the lifecycle of the kernel. To guarantee proper behaviour the handler should be registered right after the graph database has been started. If the specified handler instance has already been registered this method will do nothing.

Specified by:
registerKernelEventHandler in interface GraphDatabaseService
Parameters:
handler - the handler to receive events about different states in the kernel lifecycle.
Returns:
the handler passed in as the argument.

registerTransactionEventHandler

public <T> TransactionEventHandler<T> registerTransactionEventHandler(TransactionEventHandler<T> handler)
Description copied from interface: GraphDatabaseService
Registers handler as a handler for transaction events which are generated from different places in the lifecycle of each transaction. To guarantee that the handler gets all events properly it shouldn't be registered when the application is running (i.e. in the middle of one or more transactions). If the specified handler instance has already been registered this method will do nothing.

Specified by:
registerTransactionEventHandler in interface GraphDatabaseService
Type Parameters:
T - the type of state object used in the handler, see more documentation about it at TransactionEventHandler.
Parameters:
handler - the handler to receive events about different states in transaction lifecycles.
Returns:
the handler passed in as the argument.

unregisterKernelEventHandler

public KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
Description copied from interface: GraphDatabaseService
Unregisters handler from the list of kernel event handlers. If handler hasn't been registered with GraphDatabaseService.registerKernelEventHandler(KernelEventHandler) prior to calling this method an IllegalStateException will be thrown. After a successful call to this method the handler will no longer receive any kernel events.

Specified by:
unregisterKernelEventHandler in interface GraphDatabaseService
Parameters:
handler - the handler to receive events about different states in the kernel lifecycle.
Returns:
the handler passed in as the argument.

unregisterTransactionEventHandler

public <T> TransactionEventHandler<T> unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
Description copied from interface: GraphDatabaseService
Unregisters handler from the list of transaction event handlers. If handler hasn't been registered with GraphDatabaseService.registerTransactionEventHandler(TransactionEventHandler) prior to calling this method an IllegalStateException will be thrown. After a successful call to this method the handler will no longer receive any transaction events.

Specified by:
unregisterTransactionEventHandler in interface GraphDatabaseService
Type Parameters:
T - the type of state object used in the handler, see more documentation about it at TransactionEventHandler.
Parameters:
handler - the handler to receive events about different states in transaction lifecycles.
Returns:
the handler passed in as the argument.

getMasterServerIfMaster

public org.neo4j.kernel.ha.MasterServer getMasterServerIfMaster()

getMachineId

protected int getMachineId()

isMaster

public boolean isMaster()

createBroker

protected org.neo4j.kernel.ha.Broker createBroker()

createClusterClient

protected org.neo4j.kernel.ha.ClusterClient createClusterClient()

getStoreDir

public String getStoreDir()
Specified by:
getStoreDir in interface GraphDatabaseAPI

getDependencyResolver

public DependencyResolver getDependencyResolver()

getKernelPanicGenerator

public org.neo4j.kernel.impl.core.KernelPanicEventGenerator getKernelPanicGenerator()
Specified by:
getKernelPanicGenerator in interface GraphDatabaseAPI

getPersistenceSource

public org.neo4j.kernel.impl.persistence.PersistenceSource getPersistenceSource()
Specified by:
getPersistenceSource in interface GraphDatabaseAPI

getGuard

public Guard getGuard()
Specified by:
getGuard in interface GraphDatabaseAPI

getStoreId

public org.neo4j.kernel.impl.nioneo.store.StoreId getStoreId()
Specified by:
getStoreId in interface GraphDatabaseAPI

Neo4j Enterprise

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