use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class UnsafeRaftReplicateOp method handleResponse.
@Override
CallStatus handleResponse(long commitIndex, Object response) {
if (response == PostponedResponse.INSTANCE) {
RaftService service = getService();
service.registerUnsafeWaitingOperation(groupId, commitIndex, this);
return CallStatus.VOID;
}
return CallStatus.RESPONSE;
}
use of com.hazelcast.cp.internal.RaftService 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);
}
use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class AppendFailureResponseOp method run.
@Override
public void run() {
RaftService service = getService();
service.handleAppendResponse(groupId, appendResponse, target);
}
use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class InstallSnapshotOp method run.
@Override
public void run() {
RaftService service = getService();
service.handleSnapshot(groupId, installSnapshot, target);
}
use of com.hazelcast.cp.internal.RaftService in project hazelcast by hazelcast.
the class VoteRequestOp method run.
@Override
public void run() {
RaftService service = getService();
service.handleVoteRequest(groupId, voteRequest, target);
}
Aggregations