use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class ClusterServiceImpl method createMember.
private MemberImpl createMember(MemberInfo memberInfo, String ipV6ScopeId) {
Address address = memberInfo.getAddress();
address.setScopeId(ipV6ScopeId);
return new MemberImpl(address, memberInfo.getVersion(), thisAddress.equals(address), memberInfo.getUuid(), (HazelcastInstanceImpl) nodeEngine.getHazelcastInstance(), memberInfo.getAttributes(), memberInfo.isLiteMember());
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class ClusterServiceImpl method registerThisMember.
private void registerThisMember() {
MemberImpl thisMember = node.getLocalMember();
setMembers(thisMember);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMap method createNew.
/**
* Creates a new {@code MemberMap} including given members.
*
* @param members members
* @return a new {@code MemberMap}
*/
static MemberMap createNew(MemberImpl... members) {
Map<Address, MemberImpl> addressMap = new LinkedHashMap<Address, MemberImpl>();
Map<String, MemberImpl> uuidMap = new LinkedHashMap<String, MemberImpl>();
for (MemberImpl member : members) {
putMember(addressMap, uuidMap, member);
}
return new MemberMap(addressMap, uuidMap);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMap method cloneAdding.
/**
* Creates clone of source {@code MemberMap} additionally including new members.
*
* @param source source map
* @param newMembers new members to add
* @return clone map
*/
static MemberMap cloneAdding(MemberMap source, MemberImpl... newMembers) {
Map<Address, MemberImpl> addressMap = new LinkedHashMap<Address, MemberImpl>(source.addressToMemberMap);
Map<String, MemberImpl> uuidMap = new LinkedHashMap<String, MemberImpl>(source.uuidToMemberMap);
for (MemberImpl member : newMembers) {
putMember(addressMap, uuidMap, member);
}
return new MemberMap(addressMap, uuidMap);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMap method putMember.
private static void putMember(Map<Address, MemberImpl> addressMap, Map<String, MemberImpl> uuidMap, MemberImpl member) {
MemberImpl current = addressMap.put(member.getAddress(), member);
if (current != null) {
throw new IllegalArgumentException("Replacing existing member with address: " + member);
}
current = uuidMap.put(member.getUuid(), member);
if (current != null) {
throw new IllegalArgumentException("Replacing existing member with uuid: " + member);
}
}
Aggregations