Hazelcast C++ Client
Public Member Functions | Friends | List of all members
hazelcast::client::cluster::memberselector::MemberSelector Class Referenceabstract

#include <MemberSelectors.h>

+ Inheritance diagram for hazelcast::client::cluster::memberselector::MemberSelector:

Public Member Functions

virtual bool select (const Member &member) const =0
 Decides if the given member will be part of an operation or not. More...
 
virtual void toString (std::ostream &os) const =0
 

Friends

std::ostream & operator<< (std::ostream &os, const MemberSelector &aSelector)
 

Detailed Description

Implementations of this interface select members that are capable of executing a special kind of task.
The select(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) {
         std::string *attribute = member.getAttribute("my.special.executor")
        return attribute !=NULL && *attribute" == my.special.executor";
    }
}

Member Function Documentation

◆ select()

virtual bool hazelcast::client::cluster::memberselector::MemberSelector::select ( const Member member) const
pure virtual

Decides if the given member will be part of an operation or not.

Parameters
memberthe member instance to decide upon
Returns
true if the member should take part in the operation, false otherwise

The documentation for this class was generated from the following file: