use of com.hazelcast.spi.impl.operationservice.CallStatus in project hazelcast by hazelcast.
the class OperationRunnerImpl method call.
private void call(Operation op) throws Exception {
CallStatus callStatus = op.call();
switch(callStatus.ordinal()) {
case RESPONSE_ORDINAL:
int backupAcks = backupHandler.sendBackups(op);
Object response = op.getResponse();
if (backupAcks > 0) {
response = new NormalResponse(response, op.getCallId(), backupAcks, op.isUrgent());
}
try {
op.sendResponse(response);
} catch (ResponseAlreadySentException e) {
logOperationError(op, e);
}
afterRun(op);
break;
case VOID_ORDINAL:
backupHandler.sendBackups(op);
afterRun(op);
break;
case OFFLOAD_ORDINAL:
op.afterRun();
Offload offload = (Offload) callStatus;
offload.init(nodeEngine, operationService.asyncOperations);
offload.start();
break;
case WAIT_ORDINAL:
nodeEngine.getOperationParker().park((BlockingOperation) op);
break;
default:
throw new IllegalStateException();
}
}
Aggregations