Package com.hazelcast.cluster
Interface MemberSelector
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface MemberSelector
Implementations of this interface select members that are capable of executing a special kind of task.
Theselect(Member)
method is called for every available member in the cluster and it is up to the implementation to decide if the member is going to be used or not.For example, a basic implementation could select members on the existence of a special attribute in the members, like the following example:
public class MyMemberSelector implements MemberSelector { public boolean select(Member member) { return Boolean.TRUE.equals(member.getAttribute("my.special.executor")); } }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
select(Member member)
Decides if the given member will be part of an operation or not.
-
-
-
Method Detail
-
select
boolean select(Member member)
Decides if the given member will be part of an operation or not.- Parameters:
member
- the member instance to decide upon- Returns:
- true if the member should take part in the operation, false otherwise
-
-