Search in sources :

Example 1 with PublishActiveCPMembersOp

use of com.hazelcast.cp.internal.raftop.metadata.PublishActiveCPMembersOp in project hazelcast by hazelcast.

the class MetadataRaftGroupManager method broadcastActiveCPMembers.

void broadcastActiveCPMembers() {
    if (!(isDiscoveryCompleted() && isMetadataGroupLeader())) {
        return;
    }
    RaftGroupId metadataGroupId = getMetadataGroupId();
    long commitIndex = this.activeMembersCommitIndex;
    Collection<CPMemberInfo> cpMembers = this.activeMembers;
    if (cpMembers.isEmpty()) {
        return;
    }
    Set<Member> clusterMembers = nodeEngine.getClusterService().getMembers();
    OperationService operationService = nodeEngine.getOperationService();
    Operation op = new PublishActiveCPMembersOp(metadataGroupId, commitIndex, cpMembers);
    for (Member member : clusterMembers) {
        if (member.localMember()) {
            continue;
        }
        operationService.send(op, member.getAddress());
    }
}
Also used : PublishActiveCPMembersOp(com.hazelcast.cp.internal.raftop.metadata.PublishActiveCPMembersOp) OperationService(com.hazelcast.spi.impl.operationservice.OperationService) Operation(com.hazelcast.spi.impl.operationservice.Operation) Member(com.hazelcast.cluster.Member)

Aggregations

Member (com.hazelcast.cluster.Member)1 PublishActiveCPMembersOp (com.hazelcast.cp.internal.raftop.metadata.PublishActiveCPMembersOp)1 Operation (com.hazelcast.spi.impl.operationservice.Operation)1 OperationService (com.hazelcast.spi.impl.operationservice.OperationService)1