use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class ClusterHeartbeatManager method sendMemberListToOthers.
/** Invoked on the master to send the member list (see {@link MemberInfoUpdateOperation}) to non-master nodes. */
private void sendMemberListToOthers() {
if (!node.isMaster()) {
return;
}
Collection<MemberImpl> members = clusterService.getMemberImpls();
List<MemberInfo> memberInfos = createMemberInfoList(members);
for (MemberImpl member : members) {
if (member.localMember()) {
continue;
}
MemberInfoUpdateOperation op = new MemberInfoUpdateOperation(member.getUuid(), memberInfos, clusterClock.getClusterTime(), null, false);
nodeEngine.getOperationService().send(op, member.getAddress());
}
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberSelectingIteratorTest method before.
@Before
public void before() throws Exception {
MemberVersion version = new MemberVersion(BuildInfoProvider.BUILD_INFO.getVersion());
thisMember = new MemberImpl(new Address("localhost", 5701), version, true, true);
matchingMember = new MemberImpl(new Address("localhost", 5702), version, false, true);
matchingMember2 = new MemberImpl(new Address("localhost", 5703), version, false, true);
nonMatchingMember = new MemberImpl(new Address("localhost", 5704), version, false, false);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMapTest method assertMemberSet.
private static void assertMemberSet(MemberMap map) {
for (MemberImpl member : map.getMembers()) {
assertContains(map, member.getAddress());
assertContains(map, member.getUuid());
assertEquals(member, map.getMember(member.getAddress()));
assertEquals(member, map.getMember(member.getUuid()));
}
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMapTest method create_failsWithDuplicateUuid.
@Test(expected = IllegalArgumentException.class)
public void create_failsWithDuplicateUuid() {
MemberImpl member1 = newMember(5000);
MemberImpl member2 = new MemberImpl(newAddress(5001), VERSION, false, member1.getUuid(), null);
MemberMap.createNew(member1, member2);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberMapTest method getMembers_ordered.
@Test
public void getMembers_ordered() {
MemberImpl[] members = new MemberImpl[10];
for (int i = 0; i < members.length; i++) {
members[i] = newMember(5000 + i);
}
MemberMap map = MemberMap.createNew(members);
Set<MemberImpl> memberSet = map.getMembers();
int index = 0;
for (MemberImpl member : memberSet) {
assertSame(members[index++], member);
}
}
Aggregations