models.utils.LogUtils.printLogNormal("Status Change: Member Removed " + ClusterState.memberLoad.size());
}
}
} else if (message instanceof MemberUp) {
MemberUp mUp = (MemberUp) message;
if (!mUp.member().address().equals(cluster.selfAddress())) {
ClusterState.memberLoad.put(mUp.member().address(), new AtomicInteger(0));
Pattern pattern = Pattern.compile("@.+:");
Matcher matcher = pattern.matcher(mUp.member().address().toString());
if (matcher.find()) {
String url = matcher.group().substring(1, matcher.end()-matcher.start()-1);
String port = mUp.member().address().toString().substring(mUp.member().address().toString().length()-4);
ClusterState.memberStates.put(url + ":" + port, clusterState.new State(true, true));
}
models.utils.LogUtils.printLogNormal("MemberUp : "
+ ClusterState.memberLoad.size()
+ "Member Address : "
+ mUp.member().address().toString());
}
} else if (message instanceof MemberRemoved) {
MemberRemoved mRe = (MemberRemoved) message;
ClusterState.memberLoad.remove(mRe.member().address());