Class SwitchAdminHandler
java.lang.Object
org.jgroups.admin.AdminHandler
org.jgroups.admin.SwitchAdminHandler
Manages the switch from one protocol configuration to another one (same JGroups version).
Details in https://redhat.atlassian.net/browse/JGRP-3043
- Since:
- 5.6.0
- Author:
- Bela Ban
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprotected List<TwoPhaseCommit> static final Stringstatic final Stringstatic final Stringprotected SwitchListenerprotected JChannelprotected List<TwoPhaseCommit> static final Stringstatic final Stringstatic final Stringstatic final Stringprotected longstatic final StringFields inherited from class AdminHandler
ch, FAIL, OK -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static JChannelcreateNewChannel(int version, String config, String name) protected static StringcreateNewStack(String new_config, int version) executeRequest(String req) booleanhandleConnect(String s, Address sender) Connects the channel and waits for expected_members.booleanhandleCreateNewStack(String s, Address sender) Gets the version and config.voidhandleRequest(Message msg, AdminHeader hdr) voidhandleResponse(Message msg, AdminHeader hdr) protected voidnotifyListener(double percentage, String msg) protected static Stringprotected static Stringprotected voidRolls back already completed phases if a later phase fails (latest completed first)booleanTriggers a switch to a new configuration.timeout(long t) Methods inherited from class AdminHandler
channel, handleMessage, sendRequest, sendRequest, sendResponse, sendResponse
-
Field Details
-
KEY
- See Also:
-
INSERT_VERSION
- See Also:
-
ROLLBACK_INSERT_VERSION
- See Also:
-
CREATE_NEW_STACK
- See Also:
-
ROLLBACK_NEW_STACK
- See Also:
-
PREPARE_CONNECT
- See Also:
-
ROLLBACK_CONNECT
- See Also:
-
COMMIT_CONNECT
- See Also:
-
COMMIT_CONNECT_SINGLE
- See Also:
-
VERSION
- See Also:
-
CFG
- See Also:
-
listener
-
timeout
protected long timeout -
phases
-
completed_phases
-
new_channel
-
-
Constructor Details
-
SwitchAdminHandler
-
-
Method Details
-
listener
-
timeout
-
executeRequest
- Overrides:
executeRequestin classAdminHandler
-
switchToNewConfiguration
Triggers a switch to a new configuration. Returns true when the switch was successful, else false. False means that all cluster members are still running the current configuration. -
handleRequest
- Specified by:
handleRequestin classAdminHandler
-
handleResponse
- Specified by:
handleResponsein classAdminHandler
-
handleCreateNewStack
Gets the version and config. Creates a new protocol stack with the old channel's address injected into it. Adds VERSION (with the received version) above the transport. Then the up_handler and receiver of the old channel are nulled (and saved for later).
On a rollback, the new stack is destroyed and the up_handler and receiver of the old channel are re-inserted.
On a commit, the new protocol stack is set in the existing channel and up_handler and receiver are re-inserted. The old stack is then destroyed. -
handleConnect
-
notifyListener
-
print
-
createNewStack
-
createNewChannel
-
rollbackCompletedPhases
protected void rollbackCompletedPhases()Rolls back already completed phases if a later phase fails (latest completed first) -
readFile
-