public abstract class InternalAbstractGraphDatabase extends AbstractGraphDatabase implements GraphDatabaseService, GraphDatabaseAPI
Modifier and Type | Class and Description |
---|---|
static class |
InternalAbstractGraphDatabase.Configuration |
protected class |
InternalAbstractGraphDatabase.DefaultKernelData |
Modifier and Type | Field and Description |
---|---|
protected BridgingCacheAccess |
cacheBridge |
protected org.neo4j.kernel.impl.core.Caches |
caches |
protected org.neo4j.kernel.impl.cleanup.CleanupService |
cleanupService |
protected Config |
config |
protected DependencyResolver |
dependencyResolver |
protected DiagnosticsManager |
diagnosticsManager |
protected KernelData |
extensions |
protected org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction |
fileSystem |
protected Guard |
guard |
protected IdGeneratorFactory |
idGeneratorFactory |
protected org.neo4j.kernel.IndexManagerImpl |
indexManager |
protected org.neo4j.kernel.impl.index.IndexStore |
indexStore |
protected org.neo4j.kernel.impl.util.JobScheduler |
jobScheduler |
protected KernelAPI |
kernelAPI |
protected KernelEventHandlers |
kernelEventHandlers |
protected org.neo4j.kernel.impl.core.KernelPanicEventGenerator |
kernelPanicEventGenerator |
protected org.neo4j.kernel.impl.core.LabelTokenHolder |
labelTokenHolder |
protected LifeSupport |
life |
protected org.neo4j.kernel.impl.transaction.LockManager |
lockManager |
protected org.neo4j.kernel.impl.transaction.xaframework.LogBufferFactory |
logBufferFactory |
protected Logging |
logging |
protected org.neo4j.kernel.impl.util.StringLogger |
msgLog |
protected org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource |
neoDataSource |
protected org.neo4j.kernel.NodeAutoIndexerImpl |
nodeAutoIndexer |
protected org.neo4j.kernel.impl.core.NodeManager |
nodeManager |
protected Map<String,String> |
params |
protected org.neo4j.kernel.impl.persistence.PersistenceManager |
persistenceManager |
protected org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource |
persistenceSource |
protected org.neo4j.kernel.impl.core.PropertyKeyTokenHolder |
propertyKeyTokenHolder |
protected org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier |
recoveryVerifier |
protected org.neo4j.kernel.impl.core.TokenCreator |
relationshipTypeCreator |
protected org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder |
relationshipTypeTokenHolder |
protected org.neo4j.kernel.RelationshipAutoIndexerImpl |
relAutoIndexer |
protected Schema |
schema |
protected org.neo4j.kernel.impl.transaction.TransactionStateFactory |
stateFactory |
protected ThreadToStatementContextBridge |
statementContextProvider |
protected File |
storeDir |
protected org.neo4j.kernel.impl.nioneo.store.StoreFactory |
storeFactory |
protected org.neo4j.kernel.impl.nioneo.store.StoreId |
storeId |
protected StoreLockerLifecycleAdapter |
storeLocker |
protected org.neo4j.kernel.impl.core.TxEventSyncHookFactory |
syncHook |
protected TransactionEventHandlers |
transactionEventHandlers |
protected org.neo4j.kernel.impl.transaction.TxHook |
txHook |
protected org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator |
txIdGenerator |
protected org.neo4j.kernel.impl.transaction.AbstractTransactionManager |
txManager |
protected org.neo4j.kernel.impl.api.UpdateableSchemaState |
updateableSchemaState |
protected org.neo4j.kernel.impl.transaction.XaDataSourceManager |
xaDataSourceManager |
protected org.neo4j.kernel.impl.transaction.xaframework.XaFactory |
xaFactory |
Modifier | Constructor and Description |
---|---|
protected |
InternalAbstractGraphDatabase(String storeDir,
Map<String,String> params,
Iterable<Class<?>> settingsClasses,
Iterable<IndexProvider> indexProviders,
Iterable<KernelExtensionFactory<?>> kernelExtensions,
Iterable<org.neo4j.kernel.impl.cache.CacheProvider> cacheProviders,
Iterable<org.neo4j.kernel.impl.transaction.xaframework.TransactionInterceptorProvider> transactionInterceptorProviders) |
Modifier and Type | Method and Description |
---|---|
Transaction |
beginTx()
Starts a new
transaction and associates it with the current thread. |
protected Transaction |
beginTx(org.neo4j.kernel.impl.transaction.xaframework.ForceMode forceMode) |
protected void |
create() |
protected org.neo4j.kernel.impl.core.Caches |
createCaches() |
protected org.neo4j.kernel.impl.cleanup.CleanupService |
createCleanupService() |
protected org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction |
createFileSystemAbstraction() |
protected IdGeneratorFactory |
createIdGeneratorFactory() |
protected KernelData |
createKernelData() |
protected org.neo4j.kernel.impl.core.TokenCreator |
createLabelIdCreator() |
protected org.neo4j.kernel.impl.transaction.LockManager |
createLockManager() |
protected Logging |
createLogging() |
protected void |
createNeoDataSource() |
Node |
createNode()
Creates a new node.
|
Node |
createNode(Label... labels)
Creates a new node and adds the provided labels to it.
|
protected org.neo4j.kernel.impl.core.NodeProxy.NodeLookup |
createNodeLookup() |
protected org.neo4j.kernel.impl.core.TokenCreator |
createPropertyKeyCreator() |
protected org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier |
createRecoveryVerifier() |
protected org.neo4j.kernel.impl.core.RelationshipProxy.RelationshipLookups |
createRelationshipLookups() |
protected org.neo4j.kernel.impl.core.TokenCreator |
createRelationshipTypeCreator() |
protected org.neo4j.kernel.impl.nioneo.store.StoreFactory |
createStoreFactory() |
protected org.neo4j.kernel.impl.transaction.TransactionStateFactory |
createTransactionStateFactory() |
protected org.neo4j.kernel.impl.transaction.TxHook |
createTxHook() |
protected org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator |
createTxIdGenerator() |
protected org.neo4j.kernel.impl.transaction.XaDataSourceManager |
createXaDataSourceManager() |
protected void |
doAfterRecoveryAndStartup(boolean isMaster) |
boolean |
equals(Object o) |
ResourceIterable<Node> |
findNodesByLabelAndProperty(Label myLabel,
String key,
Object value)
Returns all nodes having the label, and the wanted property value.
|
Iterable<Node> |
getAllNodes()
Returns all nodes in the graph.
|
Config |
getConfig() |
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.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.
|
Iterable<RelationshipType> |
getRelationshipTypes()
Returns all relationship types currently in the underlying store.
|
org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder |
getRelationshipTypeTokenHolder() |
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() |
int |
hashCode() |
IndexManager |
index()
Returns the
IndexManager paired with this graph database service
and is the entry point for managing indexes coupled with this database. |
protected boolean |
isEphemeral() |
protected abstract boolean |
isHighlyAvailable() |
KernelEventHandler |
registerKernelEventHandler(KernelEventHandler handler)
Registers
handler as a handler for kernel events which
are generated from different places in the lifecycle of the kernel. |
protected void |
registerRecovery() |
<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. |
protected void |
run() |
Schema |
schema()
Returns the
schema manager where all things related to schema,
for example constraints and indexing on labels . |
void |
shutdown()
Shuts down Neo4j.
|
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. |
protected File storeDir
protected org.neo4j.kernel.impl.nioneo.store.StoreId storeId
protected Config config
protected DependencyResolver dependencyResolver
protected Logging logging
protected org.neo4j.kernel.impl.util.StringLogger msgLog
protected StoreLockerLifecycleAdapter storeLocker
protected KernelEventHandlers kernelEventHandlers
protected TransactionEventHandlers transactionEventHandlers
protected org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder relationshipTypeTokenHolder
protected org.neo4j.kernel.impl.core.NodeManager nodeManager
protected org.neo4j.kernel.IndexManagerImpl indexManager
protected Schema schema
protected org.neo4j.kernel.impl.core.KernelPanicEventGenerator kernelPanicEventGenerator
protected org.neo4j.kernel.impl.transaction.TxHook txHook
protected org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction fileSystem
protected org.neo4j.kernel.impl.transaction.XaDataSourceManager xaDataSourceManager
protected org.neo4j.kernel.impl.transaction.LockManager lockManager
protected IdGeneratorFactory idGeneratorFactory
protected org.neo4j.kernel.impl.core.TokenCreator relationshipTypeCreator
protected org.neo4j.kernel.impl.nioneo.xa.NioNeoDbPersistenceSource persistenceSource
protected org.neo4j.kernel.impl.core.TxEventSyncHookFactory syncHook
protected org.neo4j.kernel.impl.persistence.PersistenceManager persistenceManager
protected org.neo4j.kernel.impl.core.PropertyKeyTokenHolder propertyKeyTokenHolder
protected org.neo4j.kernel.impl.core.LabelTokenHolder labelTokenHolder
protected org.neo4j.kernel.impl.index.IndexStore indexStore
protected org.neo4j.kernel.impl.transaction.xaframework.LogBufferFactory logBufferFactory
protected org.neo4j.kernel.impl.transaction.AbstractTransactionManager txManager
protected org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator txIdGenerator
protected org.neo4j.kernel.impl.nioneo.store.StoreFactory storeFactory
protected org.neo4j.kernel.impl.transaction.xaframework.XaFactory xaFactory
protected DiagnosticsManager diagnosticsManager
protected org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource neoDataSource
protected org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier recoveryVerifier
protected Guard guard
protected org.neo4j.kernel.NodeAutoIndexerImpl nodeAutoIndexer
protected org.neo4j.kernel.RelationshipAutoIndexerImpl relAutoIndexer
protected KernelData extensions
protected org.neo4j.kernel.impl.core.Caches caches
protected org.neo4j.kernel.impl.transaction.TransactionStateFactory stateFactory
protected KernelAPI kernelAPI
protected ThreadToStatementContextBridge statementContextProvider
protected BridgingCacheAccess cacheBridge
protected org.neo4j.kernel.impl.util.JobScheduler jobScheduler
protected org.neo4j.kernel.impl.api.UpdateableSchemaState updateableSchemaState
protected org.neo4j.kernel.impl.cleanup.CleanupService cleanupService
protected final LifeSupport life
protected InternalAbstractGraphDatabase(String storeDir, Map<String,String> params, Iterable<Class<?>> settingsClasses, Iterable<IndexProvider> indexProviders, Iterable<KernelExtensionFactory<?>> kernelExtensions, Iterable<org.neo4j.kernel.impl.cache.CacheProvider> cacheProviders, Iterable<org.neo4j.kernel.impl.transaction.xaframework.TransactionInterceptorProvider> transactionInterceptorProviders)
protected void run()
protected void registerRecovery()
protected void doAfterRecoveryAndStartup(boolean isMaster)
protected void create()
protected abstract boolean isHighlyAvailable()
protected org.neo4j.kernel.impl.cleanup.CleanupService createCleanupService()
protected org.neo4j.kernel.impl.transaction.TransactionStateFactory createTransactionStateFactory()
protected org.neo4j.kernel.impl.transaction.XaDataSourceManager createXaDataSourceManager()
public DependencyResolver getDependencyResolver()
getDependencyResolver
in interface GraphDatabaseAPI
protected org.neo4j.kernel.impl.core.TokenCreator createRelationshipTypeCreator()
protected org.neo4j.kernel.impl.core.TokenCreator createPropertyKeyCreator()
protected org.neo4j.kernel.impl.core.TokenCreator createLabelIdCreator()
public void shutdown()
GraphDatabaseService
shutdown
in interface GraphDatabaseService
protected org.neo4j.kernel.impl.nioneo.store.StoreFactory createStoreFactory()
protected org.neo4j.kernel.impl.transaction.xaframework.RecoveryVerifier createRecoveryVerifier()
protected KernelData createKernelData()
protected org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator createTxIdGenerator()
protected org.neo4j.kernel.impl.core.Caches createCaches()
protected org.neo4j.kernel.impl.core.RelationshipProxy.RelationshipLookups createRelationshipLookups()
protected org.neo4j.kernel.impl.core.NodeProxy.NodeLookup createNodeLookup()
protected org.neo4j.kernel.impl.transaction.TxHook createTxHook()
protected org.neo4j.kernel.impl.nioneo.store.FileSystemAbstraction createFileSystemAbstraction()
protected IdGeneratorFactory createIdGeneratorFactory()
protected org.neo4j.kernel.impl.transaction.LockManager createLockManager()
protected Logging createLogging()
protected void createNeoDataSource()
public final String getStoreDir()
getStoreDir
in interface GraphDatabaseAPI
public org.neo4j.kernel.impl.nioneo.store.StoreId getStoreId()
getStoreId
in interface GraphDatabaseAPI
public Transaction beginTx()
GraphDatabaseService
transaction
and associates it with the current thread.
All database operations that modify the graph must be wrapped in a transaction.
If you attempt to modify the graph outside of a transaction, those operations will throw
NotInTransactionException
.
Transactions are not required for read-only operations, however it is recommended to
enclose read only operations in a transaction, because the database can be more intelligent about managing
resources. In particular, returned ResourceIterables
will be automatically released
at the end of a transaction.
If you execute read-only operations outside of a transaction, please take care that any returned
ResourceIterables
are closed correctly to avoid potential blocking of write operations.
beginTx
in interface GraphDatabaseService
protected Transaction beginTx(org.neo4j.kernel.impl.transaction.xaframework.ForceMode forceMode)
public boolean transactionRunning()
transactionRunning
in class AbstractGraphDatabase
protected boolean isEphemeral()
public Iterable<Node> getAllNodes()
GraphDatabaseService
getAllNodes
in interface GraphDatabaseService
public Iterable<RelationshipType> getRelationshipTypes()
GraphDatabaseService
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).getRelationshipTypes
in interface GraphDatabaseService
public KernelEventHandler registerKernelEventHandler(KernelEventHandler handler)
GraphDatabaseService
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.registerKernelEventHandler
in interface GraphDatabaseService
handler
- the handler to receive events about different states
in the kernel lifecycle.public <T> TransactionEventHandler<T> registerTransactionEventHandler(TransactionEventHandler<T> handler)
GraphDatabaseService
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.registerTransactionEventHandler
in interface GraphDatabaseService
T
- the type of state object used in the handler, see more
documentation about it at TransactionEventHandler
.handler
- the handler to receive events about different states
in transaction lifecycles.public KernelEventHandler unregisterKernelEventHandler(KernelEventHandler handler)
GraphDatabaseService
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.unregisterKernelEventHandler
in interface GraphDatabaseService
handler
- the handler to receive events about different states
in the kernel lifecycle.public <T> TransactionEventHandler<T> unregisterTransactionEventHandler(TransactionEventHandler<T> handler)
GraphDatabaseService
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.unregisterTransactionEventHandler
in interface GraphDatabaseService
T
- the type of state object used in the handler, see more
documentation about it at TransactionEventHandler
.handler
- the handler to receive events about different states
in transaction lifecycles.public Node createNode()
GraphDatabaseService
createNode
in interface GraphDatabaseService
public Node createNode(Label... labels)
GraphDatabaseService
createNode
in interface GraphDatabaseService
labels
- labels
to add to the created node.public Node getNodeById(long id)
GraphDatabaseService
getNodeById
in interface GraphDatabaseService
id
- the id of the nodeid
if foundpublic Relationship getRelationshipById(long id)
GraphDatabaseService
getRelationshipById
in interface GraphDatabaseService
id
- the id of the relationshipid
if foundpublic Node getReferenceNode()
GraphDatabaseService
getReferenceNode
in interface GraphDatabaseService
public TransactionBuilder tx()
tx
in interface GraphDatabaseAPI
public Guard getGuard()
getGuard
in interface GraphDatabaseAPI
public KernelData getKernelData()
getKernelData
in interface GraphDatabaseAPI
public IndexManager index()
GraphDatabaseService
IndexManager
paired with this graph database service
and is the entry point for managing indexes coupled with this database.index
in interface GraphDatabaseService
IndexManager
for this database.public Schema schema()
GraphDatabaseService
schema manager
where all things related to schema,
for example constraints and indexing on labels
.schema
in interface GraphDatabaseService
schema manager
for this database.public Config getConfig()
public org.neo4j.kernel.impl.core.NodeManager getNodeManager()
getNodeManager
in interface GraphDatabaseAPI
public org.neo4j.kernel.impl.transaction.LockManager getLockManager()
getLockManager
in interface GraphDatabaseAPI
public org.neo4j.kernel.impl.transaction.XaDataSourceManager getXaDataSourceManager()
getXaDataSourceManager
in interface GraphDatabaseAPI
public TransactionManager getTxManager()
getTxManager
in interface GraphDatabaseAPI
public org.neo4j.kernel.impl.core.RelationshipTypeTokenHolder getRelationshipTypeTokenHolder()
getRelationshipTypeTokenHolder
in interface GraphDatabaseAPI
public IdGeneratorFactory getIdGeneratorFactory()
getIdGeneratorFactory
in interface GraphDatabaseAPI
public DiagnosticsManager getDiagnosticsManager()
getDiagnosticsManager
in interface GraphDatabaseAPI
public org.neo4j.kernel.impl.persistence.PersistenceSource getPersistenceSource()
getPersistenceSource
in interface GraphDatabaseAPI
public final org.neo4j.kernel.impl.util.StringLogger getMessageLog()
getMessageLog
in interface GraphDatabaseAPI
public org.neo4j.kernel.impl.transaction.xaframework.TxIdGenerator getTxIdGenerator()
getTxIdGenerator
in interface GraphDatabaseAPI
public org.neo4j.kernel.impl.core.KernelPanicEventGenerator getKernelPanicGenerator()
getKernelPanicGenerator
in interface GraphDatabaseAPI
public ResourceIterable<Node> findNodesByLabelAndProperty(Label myLabel, String key, Object value)
GraphDatabaseService
If no indexes exist for the label/property combination, the database will
scan all labelled nodes looking for the property value.
If you call this operation outside of a transaction, please take care that the returned
ResourceIterable
is closed correctly to avoid potential blocking of write operations.
findNodesByLabelAndProperty
in interface GraphDatabaseService
myLabel
- consider nodes with this labelkey
- required property keyvalue
- required property valueCopyright © 2002-2013 The Neo4j Graph Database Project. All Rights Reserved.