use of com.hazelcast.cp.internal.RaftNodeAware in project hazelcast by hazelcast.
the class RaftQueryOp method run.
@Override
public final void run() {
RaftService service = getService();
RaftNode raftNode = service.getRaftNode(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;
}
if (op instanceof RaftNodeAware) {
((RaftNodeAware) op).setRaftNode(raftNode);
}
raftNode.query(op, queryPolicy).whenCompleteAsync(this, CALLER_RUNS);
}
Aggregations