use of com.hazelcast.internal.cluster.ClusterService in project hazelcast by hazelcast.
the class ClusterServiceMemberListTest method verifyMembersFromDataMember.
private void verifyMembersFromDataMember(final HazelcastInstance instance) {
final Member localMember = getLocalMember(instance);
final ClusterService clusterService = getClusterService(instance);
final Collection<Member> liteMembers = clusterService.getMembers(LITE_MEMBER_SELECTOR);
final Collection<Member> dataMembers = clusterService.getMembers(DATA_MEMBER_SELECTOR);
assertContains(dataMembers, localMember);
assertNotContains(liteMembers, localMember);
final Collection<Member> dataMembersWithoutThis = clusterService.getMembers(MemberSelectors.and(DATA_MEMBER_SELECTOR, NON_LOCAL_MEMBER_SELECTOR));
assertNotContains(dataMembersWithoutThis, localMember);
final Collection<Member> liteMembersWithThis = clusterService.getMembers(MemberSelectors.or(LITE_MEMBER_SELECTOR, LOCAL_MEMBER_SELECTOR));
assertContains(liteMembersWithThis, localMember);
}
use of com.hazelcast.internal.cluster.ClusterService in project hazelcast by hazelcast.
the class ClusterServiceMemberListTest method verifySizeFromDataMember.
private void verifySizeFromDataMember(final HazelcastInstance instance) {
final ClusterService clusterService = getClusterService(instance);
assertEquals(1, clusterService.getSize(MemberSelectors.LITE_MEMBER_SELECTOR));
assertEquals(2, clusterService.getSize(MemberSelectors.DATA_MEMBER_SELECTOR));
assertEquals(1, clusterService.getSize(MemberSelectors.and(DATA_MEMBER_SELECTOR, NON_LOCAL_MEMBER_SELECTOR)));
assertEquals(2, clusterService.getSize(MemberSelectors.or(LITE_MEMBER_SELECTOR, LOCAL_MEMBER_SELECTOR)));
}
Aggregations