Class CENTRAL_LOCK2
- All Implemented Interfaces:
Lifecycle
Because the coordinator maintains all locks, no total ordering of requests is required.
CENTRAL_LOCK2 has all members send lock and unlock requests to the current coordinator. The coordinator has a queue for incoming requests, and grants locks based on order of arrival.
Contrary to CENTRAL_LOCK, CENTRAL_LOCK2 has no members who act as backups for lock information. Instead,
when the coord leaves or on a merge, the new coordinator runs a reconciliation protocol in which it fetches
information from all members about acquired locks and pending lock and unlock requests, and then creates its lock
table accordingly. During this phase, all regular request handling is paused.
This protocol requires less traffic than CENTRAL_LOCK (each request also has to be sent to the backup(s)),
but introduces communication between the new coord and all members (and thus a small pause) on coord change.
The JIRA issue is https://issues.redhat.com/browse/JGRP-2249.
- Since:
- 4.0.13
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jgroups.protocols.Locking
Locking.ClientCondition, Locking.ClientLock, Locking.ClientLockTable, Locking.LockInfoResponse, Locking.LockingHeader, Locking.Request, Locking.Response, Locking.ServerCondition, Locking.ServerLock, Locking.Type -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AddressDeprecated.protected final ResponseCollector<Locking.LockInfoResponse> Deprecated.protected longDeprecated.protected final RunnerDeprecated.protected final BlockingQueue<Locking.Request> Deprecated.Fields inherited from class org.jgroups.protocols.Locking
bypass_bundling, client_lock_table, current_lock_id, lock_listeners, lock_stripes, lock_striping_size, server_locks, use_thread_id_for_lock_owner, viewFields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Locking.LockInfoResponseDeprecated.Deprecated.protected OwnergetOwner()Deprecated.protected voidhandleLockInfoRequest(Address requester) Deprecated.protected voidhandleLockInfoResponse(Address sender, Locking.Request rsp) Deprecated.protected voidDeprecated.voidhandleView(View v) Deprecated.booleanisCoord()Deprecated.booleanDeprecated.protected voidDeprecated.intDeprecated.protected voidDeprecated.voidDeprecated.Grabs information about locks held and pending lock/unlock requests from all membersprotected voidsendAwaitConditionRequest(String lock_name, Owner owner) Deprecated.protected voidsendDeleteAwaitConditionRequest(String lock_name, Owner owner) Deprecated.protected voidsendGrantLockRequest(String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock) Deprecated.protected voidsendLockInfoRequestTo(Locking.Request req, Address[] mbrs, Address exclude) Deprecated.protected voidsendReleaseLockRequest(String lock_name, int lock_id, Owner owner) Deprecated.protected voidsendSignalConditionRequest(String lock_name, boolean all) Deprecated.voidstop()Deprecated.Called on aJChannel.disconnect(); stops work (e.g.Methods inherited from class org.jgroups.protocols.Locking
_getLock, addLockListener, bypassBundling, bypassBundling, createLock, down, getLock, getLock, getLockStripingSize, getNumClientLocks, getNumServerLocks, getView, handleAwaitRequest, handleCreateAwaitingRequest, handleCreateLockRequest, handleDeleteAwaitingRequest, handleDeleteAwaitRequest, handleDeleteLockRequest, handleLockDeniedResponse, handleLockGrantedResponse, handleLockReleasedResponse, handleLockRequest, handleRequest, handleSignalRequest, handleSignalResponse, init, notifyAwaited, notifyAwaiting, notifyLockCreated, notifyLockDeleted, notifyLocked, notifyLockRevoked, notifyUnlocked, printLocks, printServerLocks, removeLockListener, send, sendLockResponse, sendRequest, sendRequest, sendSignalResponse, setLockStripingSize, unlockAll, unlockForce, up, up, useThreadIdForLockOwner, useThreadIdForLockOwnerMethods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, policies, providedDownServices, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, start, statsEnabled, toString, up
-
Field Details
-
lock_reconciliation_timeout
protected long lock_reconciliation_timeoutDeprecated. -
coord
Deprecated. -
lock_info_responses
Deprecated. -
req_queue
Deprecated. -
req_handler
Deprecated.
-
-
Constructor Details
-
CENTRAL_LOCK2
public CENTRAL_LOCK2()Deprecated.
-
-
Method Details
-
isCoord
public boolean isCoord()Deprecated. -
getCoordinator
Deprecated. -
isRequestHandlerRunning
public boolean isRequestHandlerRunning()Deprecated. -
requestQueueSize
public int requestQueueSize()Deprecated. -
stop
public void stop()Deprecated.Description copied from class:ProtocolCalled on aJChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom. -
handleView
Deprecated.- Overrides:
handleViewin classLocking
-
requestReceived
Deprecated.- Overrides:
requestReceivedin classLocking
-
processQueue
protected void processQueue()Deprecated. -
handleLockInfoRequest
Deprecated.- Overrides:
handleLockInfoRequestin classLocking
-
handleLockInfoResponse
Deprecated.- Overrides:
handleLockInfoResponsein classLocking
-
handleLockRevoked
Deprecated.- Overrides:
handleLockRevokedin classLocking
-
runReconciliation
public void runReconciliation()Deprecated.Grabs information about locks held and pending lock/unlock requests from all members -
sendLockInfoRequestTo
Deprecated. -
getOwner
Deprecated. -
sendGrantLockRequest
protected void sendGrantLockRequest(String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock) Deprecated.- Specified by:
sendGrantLockRequestin classLocking
-
sendReleaseLockRequest
Deprecated.- Specified by:
sendReleaseLockRequestin classLocking
-
sendAwaitConditionRequest
Deprecated.- Specified by:
sendAwaitConditionRequestin classLocking
-
sendSignalConditionRequest
Deprecated.- Specified by:
sendSignalConditionRequestin classLocking
-
sendDeleteAwaitConditionRequest
Deprecated.- Specified by:
sendDeleteAwaitConditionRequestin classLocking
-
createLockInfoResponse
Deprecated.
-