org.neo4j.kernel.ha.com.master
Class MasterImpl

java.lang.Object
  extended by org.neo4j.kernel.lifecycle.LifecycleAdapter
      extended by org.neo4j.kernel.ha.com.master.MasterImpl
All Implemented Interfaces:
Master, org.neo4j.kernel.lifecycle.Lifecycle

public class MasterImpl
extends org.neo4j.kernel.lifecycle.LifecycleAdapter
implements Master

This is the real master code that executes on a master. The actual communication over network happens in MasterClient and MasterServer.


Field Summary
static int UNFINISHED_TRANSACTION_CLEANUP_DELAY
           
 
Constructor Summary
MasterImpl(org.neo4j.kernel.GraphDatabaseAPI db, org.neo4j.kernel.logging.Logging logging, org.neo4j.kernel.configuration.Config config)
           
 
Method Summary
 org.neo4j.com.Response<LockResult> acquireGraphReadLock(org.neo4j.com.RequestContext context)
           
 org.neo4j.com.Response<LockResult> acquireGraphWriteLock(org.neo4j.com.RequestContext context)
           
 org.neo4j.com.Response<LockResult> acquireIndexReadLock(org.neo4j.com.RequestContext context, String index, String key)
           
 org.neo4j.com.Response<LockResult> acquireIndexWriteLock(org.neo4j.com.RequestContext context, String index, String key)
           
 org.neo4j.com.Response<LockResult> acquireNodeReadLock(org.neo4j.com.RequestContext context, long... nodes)
           
 org.neo4j.com.Response<LockResult> acquireNodeWriteLock(org.neo4j.com.RequestContext context, long... nodes)
           
 org.neo4j.com.Response<LockResult> acquireRelationshipReadLock(org.neo4j.com.RequestContext context, long... relationships)
           
 org.neo4j.com.Response<LockResult> acquireRelationshipWriteLock(org.neo4j.com.RequestContext context, long... relationships)
           
 org.neo4j.com.Response<LockResult> acquireSchemaReadLock(org.neo4j.com.RequestContext context)
           
 org.neo4j.com.Response<LockResult> acquireSchemaWriteLock(org.neo4j.com.RequestContext context)
           
 org.neo4j.com.Response<IdAllocation> allocateIds(org.neo4j.kernel.IdType idType)
           
 org.neo4j.com.Response<Long> commitSingleResourceTransaction(org.neo4j.com.RequestContext context, String resource, org.neo4j.com.TxExtractor txGetter)
           
 org.neo4j.com.Response<Void> copyStore(org.neo4j.com.RequestContext context, org.neo4j.com.StoreWriter writer)
           
 org.neo4j.com.Response<Void> copyTransactions(org.neo4j.com.RequestContext context, String dsName, long startTxId, long endTxId)
           
 org.neo4j.com.Response<Integer> createPropertyKey(org.neo4j.com.RequestContext context, String name)
           
 org.neo4j.com.Response<Integer> createRelationshipType(org.neo4j.com.RequestContext context, String name)
           
 org.neo4j.com.Response<Void> finishTransaction(org.neo4j.com.RequestContext context, boolean success)
           
 org.neo4j.com.Response<org.neo4j.helpers.Pair<Integer,Long>> getMasterIdForCommittedTx(long txId, org.neo4j.kernel.impl.nioneo.store.StoreId storeId)
          Gets the master id for a given txId, also a checksum for that tx.
 Map<Integer,Collection<org.neo4j.com.RequestContext>> getOngoingTransactions()
           
 org.neo4j.com.Response<Void> initializeTx(org.neo4j.com.RequestContext context)
          Called when the first write operation of lock is performed for a transaction.
 org.neo4j.com.Response<Void> pullUpdates(org.neo4j.com.RequestContext context)
           
 org.neo4j.com.Response<Void> pushTransaction(org.neo4j.com.RequestContext context, String resourceName, long tx)
           
 void start()
           
 void stop()
           
 
Methods inherited from class org.neo4j.kernel.lifecycle.LifecycleAdapter
init, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNFINISHED_TRANSACTION_CLEANUP_DELAY

public static final int UNFINISHED_TRANSACTION_CLEANUP_DELAY
See Also:
Constant Field Values
Constructor Detail

MasterImpl

public MasterImpl(org.neo4j.kernel.GraphDatabaseAPI db,
                  org.neo4j.kernel.logging.Logging logging,
                  org.neo4j.kernel.configuration.Config config)
Method Detail

start

public void start()
           throws Throwable
Specified by:
start in interface org.neo4j.kernel.lifecycle.Lifecycle
Overrides:
start in class org.neo4j.kernel.lifecycle.LifecycleAdapter
Throws:
Throwable

stop

public void stop()
Specified by:
stop in interface org.neo4j.kernel.lifecycle.Lifecycle
Overrides:
stop in class org.neo4j.kernel.lifecycle.LifecycleAdapter

initializeTx

public org.neo4j.com.Response<Void> initializeTx(org.neo4j.com.RequestContext context)
Description copied from interface: Master
Called when the first write operation of lock is performed for a transaction.

Specified by:
initializeTx in interface Master

acquireNodeReadLock

public org.neo4j.com.Response<LockResult> acquireNodeReadLock(org.neo4j.com.RequestContext context,
                                                              long... nodes)
Specified by:
acquireNodeReadLock in interface Master

acquireNodeWriteLock

public org.neo4j.com.Response<LockResult> acquireNodeWriteLock(org.neo4j.com.RequestContext context,
                                                               long... nodes)
Specified by:
acquireNodeWriteLock in interface Master

acquireRelationshipReadLock

public org.neo4j.com.Response<LockResult> acquireRelationshipReadLock(org.neo4j.com.RequestContext context,
                                                                      long... relationships)
Specified by:
acquireRelationshipReadLock in interface Master

acquireRelationshipWriteLock

public org.neo4j.com.Response<LockResult> acquireRelationshipWriteLock(org.neo4j.com.RequestContext context,
                                                                       long... relationships)
Specified by:
acquireRelationshipWriteLock in interface Master

acquireGraphReadLock

public org.neo4j.com.Response<LockResult> acquireGraphReadLock(org.neo4j.com.RequestContext context)
Specified by:
acquireGraphReadLock in interface Master

acquireGraphWriteLock

public org.neo4j.com.Response<LockResult> acquireGraphWriteLock(org.neo4j.com.RequestContext context)
Specified by:
acquireGraphWriteLock in interface Master

allocateIds

public org.neo4j.com.Response<IdAllocation> allocateIds(org.neo4j.kernel.IdType idType)
Specified by:
allocateIds in interface Master

commitSingleResourceTransaction

public org.neo4j.com.Response<Long> commitSingleResourceTransaction(org.neo4j.com.RequestContext context,
                                                                    String resource,
                                                                    org.neo4j.com.TxExtractor txGetter)
Specified by:
commitSingleResourceTransaction in interface Master

finishTransaction

public org.neo4j.com.Response<Void> finishTransaction(org.neo4j.com.RequestContext context,
                                                      boolean success)
Specified by:
finishTransaction in interface Master

createRelationshipType

public org.neo4j.com.Response<Integer> createRelationshipType(org.neo4j.com.RequestContext context,
                                                              String name)
Specified by:
createRelationshipType in interface Master

createPropertyKey

public org.neo4j.com.Response<Integer> createPropertyKey(org.neo4j.com.RequestContext context,
                                                         String name)
Specified by:
createPropertyKey in interface Master

pullUpdates

public org.neo4j.com.Response<Void> pullUpdates(org.neo4j.com.RequestContext context)
Specified by:
pullUpdates in interface Master

getMasterIdForCommittedTx

public org.neo4j.com.Response<org.neo4j.helpers.Pair<Integer,Long>> getMasterIdForCommittedTx(long txId,
                                                                                              org.neo4j.kernel.impl.nioneo.store.StoreId storeId)
Description copied from interface: Master
Gets the master id for a given txId, also a checksum for that tx.

Specified by:
getMasterIdForCommittedTx in interface Master
Parameters:
txId - the transaction id to get the data for.
storeId - clients store id.
Returns:
the master id for a given txId, also a checksum for that tx.

copyStore

public org.neo4j.com.Response<Void> copyStore(org.neo4j.com.RequestContext context,
                                              org.neo4j.com.StoreWriter writer)
Specified by:
copyStore in interface Master

copyTransactions

public org.neo4j.com.Response<Void> copyTransactions(org.neo4j.com.RequestContext context,
                                                     String dsName,
                                                     long startTxId,
                                                     long endTxId)
Specified by:
copyTransactions in interface Master

acquireIndexReadLock

public org.neo4j.com.Response<LockResult> acquireIndexReadLock(org.neo4j.com.RequestContext context,
                                                               String index,
                                                               String key)
Specified by:
acquireIndexReadLock in interface Master

acquireIndexWriteLock

public org.neo4j.com.Response<LockResult> acquireIndexWriteLock(org.neo4j.com.RequestContext context,
                                                                String index,
                                                                String key)
Specified by:
acquireIndexWriteLock in interface Master

acquireSchemaReadLock

public org.neo4j.com.Response<LockResult> acquireSchemaReadLock(org.neo4j.com.RequestContext context)
Specified by:
acquireSchemaReadLock in interface Master

acquireSchemaWriteLock

public org.neo4j.com.Response<LockResult> acquireSchemaWriteLock(org.neo4j.com.RequestContext context)
Specified by:
acquireSchemaWriteLock in interface Master

pushTransaction

public org.neo4j.com.Response<Void> pushTransaction(org.neo4j.com.RequestContext context,
                                                    String resourceName,
                                                    long tx)
Specified by:
pushTransaction in interface Master

getOngoingTransactions

public Map<Integer,Collection<org.neo4j.com.RequestContext>> getOngoingTransactions()


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