use of com.alibaba.maxgraph.sdkcommon.client.Endpoint in project GraphScope by alibaba.
the class RpcConnector method cancelDataflow.
public void cancelDataflow(TimelyResultProcessor resultProcessor, String queryId) throws Exception {
List<Endpoint> executorAddrList = getTargetExecutorAddrs();
String logMsg = new String("");
boolean isSuccess = false;
for (int i = 0; i < executorAddrList.size(); i++) {
MaxGraphCtrlServiceBlockingStub stub = randomCtrlStub(executorAddrList.get(i));
CancelDataflowResponse resp = stub.cancelDataflow(CancelDataflowRequest.newBuilder().setQueryId(queryId).build());
if (resp.getSuccess()) {
isSuccess = true;
logMsg = String.format("Cancel %s in worker %d success.", queryId, i);
} else {
logMsg = String.format("Cancel %s in worker %d failed.", queryId, i);
}
LOG.info(logMsg);
}
String resultMsg;
if (isSuccess) {
resultMsg = "Cancel success.";
} else {
resultMsg = "Cancel failed.";
}
resultProcessor.process(new PropertyValueResult(resultMsg));
resultProcessor.finish();
}
Aggregations