Search in sources :

Example 1 with CreateRaftNodeOp

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

the class RaftInvocationManager method triggerRaftNodeCreation.

void triggerRaftNodeCreation(CPGroupSummary group) {
    for (CPMember groupMember : group.members()) {
        if (groupMember.equals(raftService.getLocalCPMember())) {
            ExecutionService executionService = nodeEngine.getExecutionService();
            executionService.execute(CP_SUBSYSTEM_EXECUTOR, () -> raftService.createRaftNode(group.id(), group.initialMembers()));
        } else {
            Operation op = new CreateRaftNodeOp(group.id(), group.initialMembers());
            OperationService operationService = nodeEngine.getOperationService();
            operationService.send(op, groupMember.getAddress());
        }
    }
}
Also used : CreateRaftNodeOp(com.hazelcast.cp.internal.raftop.metadata.CreateRaftNodeOp) Operation(com.hazelcast.spi.impl.operationservice.Operation) OperationService(com.hazelcast.spi.impl.operationservice.OperationService) ExecutionService(com.hazelcast.spi.impl.executionservice.ExecutionService) CPMember(com.hazelcast.cp.CPMember)

Aggregations

CPMember (com.hazelcast.cp.CPMember)1 CreateRaftNodeOp (com.hazelcast.cp.internal.raftop.metadata.CreateRaftNodeOp)1 ExecutionService (com.hazelcast.spi.impl.executionservice.ExecutionService)1 Operation (com.hazelcast.spi.impl.operationservice.Operation)1 OperationService (com.hazelcast.spi.impl.operationservice.OperationService)1