use of com.hazelcast.hotrestart.InternalHotRestartService in project hazelcast by hazelcast.
the class TriggerPartialStartRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject out) throws Exception {
Node node = mcs.getHazelcastInstance().node;
final InternalHotRestartService hotRestartService = node.getNodeExtension().getInternalHotRestartService();
final boolean done = hotRestartService.triggerPartialStart();
String result = done ? SUCCESS_RESULT : FAILED_RESULT;
out.add("result", result);
}
use of com.hazelcast.hotrestart.InternalHotRestartService in project hazelcast by hazelcast.
the class ClusterServiceImpl method removeMember.
private void removeMember(MemberImpl deadMember) {
logger.info("Removing " + deadMember);
lock.lock();
try {
MemberMap currentMembers = memberMapRef.get();
final Address deadAddress = deadMember.getAddress();
if (currentMembers.contains(deadAddress)) {
clusterHeartbeatManager.removeMember(deadMember);
MemberMap newMembers = MemberMap.cloneExcluding(currentMembers, deadMember);
memberMapRef.set(newMembers);
if (node.isMaster()) {
if (logger.isFineEnabled()) {
logger.fine(deadMember + " is dead, sending remove to all other members...");
}
sendMemberRemoveOperation(deadMember);
}
final ClusterState clusterState = clusterStateManager.getState();
if (clusterState != ClusterState.ACTIVE) {
if (logger.isFineEnabled()) {
logger.fine(deadMember + " is dead, added to members left while cluster is " + clusterState + " state");
}
final InternalHotRestartService hotRestartService = node.getNodeExtension().getInternalHotRestartService();
if (!hotRestartService.isMemberExcluded(deadAddress, deadMember.getUuid())) {
MemberMap membersRemovedInNotActiveState = membersRemovedInNotActiveStateRef.get();
membersRemovedInNotActiveStateRef.set(MemberMap.cloneAdding(membersRemovedInNotActiveState, deadMember));
}
InternalPartitionServiceImpl partitionService = node.partitionService;
partitionService.cancelReplicaSyncRequestsTo(deadAddress);
} else {
onMemberRemove(deadMember, newMembers);
}
// async events
sendMembershipEventNotifications(deadMember, unmodifiableSet(new LinkedHashSet<Member>(newMembers.getMembers())), false);
}
} finally {
lock.unlock();
}
}
use of com.hazelcast.hotrestart.InternalHotRestartService in project hazelcast by hazelcast.
the class ClusterJoinManager method checkJoinRequest.
@SuppressWarnings("checkstyle:npathcomplexity")
private boolean checkJoinRequest(JoinRequest joinRequest, Connection connection) {
if (checkIfJoinRequestFromAnExistingMember(joinRequest, connection)) {
return true;
}
final InternalHotRestartService hotRestartService = node.getNodeExtension().getInternalHotRestartService();
Address target = joinRequest.getAddress();
String targetUuid = joinRequest.getUuid();
if (hotRestartService.isMemberExcluded(target, targetUuid)) {
logger.fine("cannot join " + target + " because it is excluded in cluster start.");
hotRestartService.notifyExcludedMember(target);
return true;
}
if (checkClusterStateBeforeJoin(target, targetUuid)) {
return true;
}
if (joinRequest.getExcludedMemberUuids().contains(node.getThisUuid())) {
logger.warning("cannot join " + target + " since this node is excluded in its list...");
hotRestartService.handleExcludedMemberUuids(target, joinRequest.getExcludedMemberUuids());
return true;
}
if (!node.getPartitionService().isMemberAllowedToJoin(target)) {
logger.warning(target + " not allowed to join right now, it seems restarted.");
return true;
}
return false;
}
Aggregations