public void resetJoinState() { lock.lock(); try { setMasterAddress(null); setJoined(false); } finally { lock.unlock(); } }
public void resetJoinState() { lock.lock(); try { setMasterAddress(null); setJoined(false); } finally { lock.unlock(); } }
private void setMasterAndJoin(Address masterAddress) { clusterService.setMasterAddress(masterAddress); node.connectionManager.getOrConnect(masterAddress); if (!sendJoinRequest(masterAddress, true)) { logger.warning("Could not create connection to possible master " + masterAddress); } }
private void setMasterAndJoin(Address masterAddress) { clusterService.setMasterAddress(masterAddress); node.connectionManager.getOrConnect(masterAddress); if (!sendJoinRequest(masterAddress, true)) { logger.warning("Could not create connection to possible master " + masterAddress); } }
public boolean setMasterAddressToJoin(final Address master) { lock.lock(); try { if (isJoined()) { Address currentMasterAddress = getMasterAddress(); if (!currentMasterAddress.equals(master)) { logger.warning("Cannot set master address to " + master + " because node is already joined! Current master: " + currentMasterAddress); } else if (logger.isFineEnabled()) { logger.fine("Master address is already set to " + master); } return false; } setMasterAddress(master); return true; } finally { lock.unlock(); } }
public boolean setMasterAddressToJoin(final Address master) { lock.lock(); try { if (isJoined()) { Address currentMasterAddress = getMasterAddress(); if (!currentMasterAddress.equals(master)) { logger.warning("Cannot set master address to " + master + " because node is already joined! Current master: " + currentMasterAddress); } else if (logger.isFineEnabled()) { logger.fine("Master address is already set to " + master); } return false; } setMasterAddress(master); return true; } finally { lock.unlock(); } }
private boolean tryStartMastershipClaim() { ClusterJoinManager clusterJoinManager = clusterService.getClusterJoinManager(); if (clusterJoinManager.isMastershipClaimInProgress()) { return false; } MemberMap memberMap = memberMapRef.get(); if (!shouldClaimMastership(memberMap)) { return false; } logger.info("Starting mastership claim process..."); // Make sure that all pending join requests are cancelled temporarily. clusterJoinManager.setMastershipClaimInProgress(); clusterService.setMasterAddress(node.getThisAddress()); return true; }
private boolean tryStartMastershipClaim() { ClusterJoinManager clusterJoinManager = clusterService.getClusterJoinManager(); if (clusterJoinManager.isMastershipClaimInProgress()) { return false; } MemberMap memberMap = memberMapRef.get(); if (!shouldClaimMastership(memberMap)) { return false; } logger.info("Starting mastership claim process..."); // Make sure that all pending join requests are cancelled temporarily. clusterJoinManager.setMastershipClaimInProgress(); clusterService.setMasterAddress(node.getThisAddress()); return true; }
+ "Master field will be unset now.", masterAddress, callerAddress, currentMaster)); clusterService.setMasterAddress(null);
+ " to %s. Sent master response as %s. Master field will be unset now...", currentMaster, callerAddress, masterAddress)); clusterService.setMasterAddress(null);
setMasterAddress(masterCandidate.getAddress());
public boolean setThisMemberAsMaster() { clusterServiceLock.lock(); try { if (clusterService.isJoined()) { logger.warning("Cannot set as master because node is already joined!"); return false; } logger.finest("This node is being set as the master"); Address thisAddress = node.getThisAddress(); MemberVersion version = node.getVersion(); clusterService.setMasterAddress(thisAddress); if (clusterService.getClusterVersion().isUnknown()) { clusterService.getClusterStateManager().setClusterVersion(version.asVersion()); } clusterService.getClusterClock().setClusterStartTime(Clock.currentTimeMillis()); clusterService.setClusterId(UuidUtil.createClusterUuid()); clusterService.getMembershipManager().setLocalMemberListJoinVersion(SINGLETON_MEMBER_LIST_VERSION); clusterService.setJoined(true); return true; } finally { clusterServiceLock.unlock(); } }
setMasterAddress(masterCandidate.getAddress());
public boolean setThisMemberAsMaster() { clusterServiceLock.lock(); try { if (clusterService.isJoined()) { logger.warning("Cannot set as master because node is already joined!"); return false; } logger.finest("This node is being set as the master"); Address thisAddress = node.getThisAddress(); MemberVersion version = node.getVersion(); clusterService.setMasterAddress(thisAddress); if (clusterService.getClusterVersion().isUnknown()) { clusterService.getClusterStateManager().setClusterVersion(version.asVersion()); } clusterService.getClusterClock().setClusterStartTime(Clock.currentTimeMillis()); clusterService.setClusterId(UuidUtil.createClusterUuid()); clusterService.getMembershipManager().setLocalMemberListJoinVersion(SINGLETON_MEMBER_LIST_VERSION); clusterService.setJoined(true); return true; } finally { clusterServiceLock.unlock(); } }