| java.lang.Object hu.netmind.persistence.node.NodeManager
NodeManager | public class NodeManager implements ServiceProvider,Runnable(Code) | | This manager enables the Store to function on a peer-to-peer
fashion with other Store instances which are pointed to the same
database. The class takes care of all IP communication related
work, such as reconnecting, communication protocoll, etc. All
synchronization points must occur through this manager, which guarantees
synchronization across all other Store instances.
author: Brautigam Robert version: Revision: $Revision$ |
Inner Class :public class NodeEntry | |
Constructor Summary | |
public | NodeManager(StoreContext context) Construct node manager, establish identity, and make
initial connection. |
Method Summary | |
public void | close() | public void | endCommit(int index, Long serial) Mark the end of a commit phase. | public void | ensureState(int newState) Ensure that, if possible the given state is reached. | public Long | getNextSerial() Get a new serial number. | public int | getNodeIndex() | public SessionInfo | lock(int index, long threadId, long txSerial, List metas, SessionInfo info, int wait, boolean ensureCurrent) Lock an object. | public void | notifyChange(List metas, Long endSerial, Long txSerial) Notify server of object changes. | public void | run() This is the heartbeat of the node. | public Long | startCommit(int index) Wait for starting a commit. | public void | unlock(int index, long threadId, long txSerial, List metas) Unlock object. | public void | updateEntries(String tableName, Long serial) Send cache update request. | public void | waitForQuery(Long serial) Wait for a query to execute with the given serial. |
HEARTBEAT_INTERVAL | public static int HEARTBEAT_INTERVAL(Code) | | |
NODE_TIMEOUT | public static int NODE_TIMEOUT(Code) | | |
STATE_CONNECTED | final public static int STATE_CONNECTED(Code) | | |
STATE_INITIALIZED | final public static int STATE_INITIALIZED(Code) | | |
STATE_OFFLINE | final public static int STATE_OFFLINE(Code) | | |
STATE_UNINITIALIZED | final public static int STATE_UNINITIALIZED(Code) | | |
STATE_WAITING | final public static int STATE_WAITING(Code) | | |
NodeManager | public NodeManager(StoreContext context)(Code) | | Construct node manager, establish identity, and make
initial connection.
|
close | public void close()(Code) | | |
endCommit | public void endCommit(int index, Long serial)(Code) | | Mark the end of a commit phase.
|
ensureState | public void ensureState(int newState)(Code) | | Ensure that, if possible the given state is reached. This method
makes all the necessary calls of state changes up and down.
|
getNextSerial | public Long getNextSerial()(Code) | | Get a new serial number.
|
getNodeIndex | public int getNodeIndex()(Code) | | |
lock | public SessionInfo lock(int index, long threadId, long txSerial, List metas, SessionInfo info, int wait, boolean ensureCurrent)(Code) | | Lock an object.
A transaction if lock failed (the transaction whichhas a lock on the object), null else. |
notifyChange | public void notifyChange(List metas, Long endSerial, Long txSerial)(Code) | | Notify server of object changes.
|
run | public void run()(Code) | | This is the heartbeat of the node. If the heartbeat fails,
meaning it can't update the database, the node is considered dead.
Secondary function of the heartbeat is, to check on nodes which
have unknown state.
|
startCommit | public Long startCommit(int index)(Code) | | Wait for starting a commit. The commit can start if
there are no queries executed with greater serial.
The serial the commit can run with. |
unlock | public void unlock(int index, long threadId, long txSerial, List metas)(Code) | | Unlock object.
|
updateEntries | public void updateEntries(String tableName, Long serial)(Code) | | Send cache update request.
|
waitForQuery | public void waitForQuery(Long serial)(Code) | | Wait for a query to execute with the given serial.
This method returns, if all commits before the given serial
are finished.
|
|
|