use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class GetLeadedGroupsOp method run.
@Override
public void run() throws Exception {
RaftService service = getService();
groups = service.getLeadedGroups();
}
use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class RaftReplicateOp method run.
@Override
public final void run() {
RaftService service = getService();
RaftNode raftNode = service.getOrInitRaftNode(groupId);
if (raftNode == null) {
if (service.isRaftGroupDestroyed(groupId)) {
sendResponse(new CPGroupDestroyedException(groupId));
} else {
sendResponse(new NotLeaderException(groupId, service.getLocalCPEndpoint(), null));
}
return;
} else if (raftNode.getStatus() == RaftNodeStatus.STEPPED_DOWN) {
sendResponse(new NotLeaderException(groupId, service.getLocalCPEndpoint(), null));
getNodeEngine().getExecutionService().execute(CP_SUBSYSTEM_EXECUTOR, () -> service.stepDownRaftNode(groupId));
return;
}
replicate(raftNode).whenCompleteAsync(this, CALLER_RUNS);
}
use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class TransferLeadershipOp method call.
@Override
public CallStatus call() throws Exception {
RaftService service = getService();
InternalCompletableFuture future = service.transferLeadership(groupId, (CPMemberInfo) destination);
future.whenCompleteAsync(this);
return CallStatus.VOID;
}
use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class AppendRequestOp method run.
@Override
public void run() {
RaftService service = getService();
service.handleAppendEntries(groupId, appendRequest, target);
}
use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class PreVoteRequestOp method run.
@Override
public void run() {
RaftService service = getService();
service.handlePreVoteRequest(groupId, voteRequest, target);
}
Aggregations