public class ClusterJoinManager extends Object
| Constructor and Description |
|---|
ClusterJoinManager(Node node,
ClusterServiceImpl clusterService,
Lock clusterServiceLock) |
| Modifier and Type | Method and Description |
|---|---|
void |
answerMasterQuestion(JoinMessage joinMessage,
Connection connection)
Respond to a
MasterDiscoveryOperation. |
void |
handleJoinRequest(JoinRequest joinRequest,
Connection connection)
Handle a
JoinRequestOperation:
If this node is not master, reply with a SetMasterOperation to let the joining node know the current
master
Otherwise, if no other join is in progress, execute the JoinRequest
|
boolean |
isJoinInProgress() |
boolean |
sendJoinRequest(Address toAddress,
boolean withCredentials)
Send join request to
toAddress. |
boolean |
sendMasterQuestion(Address toAddress)
Send a
MasterDiscoveryOperation to designated address. |
void |
setMaster(Address masterAddress,
Address callerAddress)
Set master address, if required.
|
boolean |
validateJoinMessage(JoinMessage joinMessage)
Validate that the configuration received from the remote node in
joinMessage is compatible with the
configuration of this node. |
public ClusterJoinManager(Node node, ClusterServiceImpl clusterService, Lock clusterServiceLock)
public boolean isJoinInProgress()
public void handleJoinRequest(JoinRequest joinRequest, Connection connection)
JoinRequestOperation:
SetMasterOperation to let the joining node know the current
masterJoinRequestjoinRequest - connection - JoinRequestOperationpublic boolean validateJoinMessage(JoinMessage joinMessage) throws Exception
joinMessage is compatible with the
configuration of this node.joinMessage - the JoinMessage received from another node.true if packet version of join message matches this node's packet version and configurations
are found to be compatible, otherwise false.ExceptionConfigCheckpublic boolean sendJoinRequest(Address toAddress, boolean withCredentials)
toAddress.toAddress - the currently known master address.withCredentials - use cluster credentialstrue if join request was sent successfully, otherwise false.public void setMaster(Address masterAddress, Address callerAddress)
masterAddress - address of cluster's master, as provided in SetMasterOperationcallerAddress - address of node that sent the SetMasterOperationSetMasterOperationpublic boolean sendMasterQuestion(Address toAddress)
MasterDiscoveryOperation to designated address.toAddress - the address to which the operation will be sent.true if the operation was sent, otherwise false.public void answerMasterQuestion(JoinMessage joinMessage, Connection connection)
MasterDiscoveryOperation.joinMessage - the JoinMessage from the request.connection - the connection to operation caller, to which response will be sent.MasterDiscoveryOperationCopyright © 2016 Hazelcast, Inc.. All Rights Reserved.