Search in sources :

Example 21 with Endpoint

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();
}
Also used : Endpoint(com.alibaba.maxgraph.sdkcommon.client.Endpoint) MaxGraphCtrlServiceBlockingStub(com.alibaba.maxgraph.rpc.MaxGraphCtrlServiceGrpc.MaxGraphCtrlServiceBlockingStub) PropertyValueResult(com.alibaba.maxgraph.result.PropertyValueResult) ByteString(com.google.protobuf.ByteString) Endpoint(com.alibaba.maxgraph.sdkcommon.client.Endpoint)

Aggregations

Endpoint (com.alibaba.maxgraph.sdkcommon.client.Endpoint)21 WorkerInfo (com.alibaba.maxgraph.common.client.WorkerInfo)3 MaxGraphCtrlServiceBlockingStub (com.alibaba.maxgraph.rpc.MaxGraphCtrlServiceGrpc.MaxGraphCtrlServiceBlockingStub)3 ManagedChannel (io.grpc.ManagedChannel)3 InstanceInfo (com.alibaba.maxgraph.coordinator.manager.InstanceInfo)2 ArrayList (java.util.ArrayList)2 QueryFlowOuterClass (com.alibaba.maxgraph.QueryFlowOuterClass)1 InstanceStatus (com.alibaba.maxgraph.common.InstanceStatus)1 ServerAssignment (com.alibaba.maxgraph.common.ServerAssignment)1 InstanceConfig (com.alibaba.maxgraph.common.cluster.InstanceConfig)1 LockWrapper (com.alibaba.maxgraph.common.lock.LockWrapper)1 RpcAddress (com.alibaba.maxgraph.common.rpc.RpcAddress)1 GraphSchema (com.alibaba.maxgraph.compiler.api.schema.GraphSchema)1 SchemaFetcher (com.alibaba.maxgraph.compiler.api.schema.SchemaFetcher)1 ServerDataApiClient (com.alibaba.maxgraph.coordinator.client.ServerDataApiClient)1 IteratorList (com.alibaba.maxgraph.iterator.IteratorList)1 RoleType (com.alibaba.maxgraph.proto.RoleType)1 RoutingServerInfoResp (com.alibaba.maxgraph.proto.RoutingServerInfoResp)1 RuntimeEnvList (com.alibaba.maxgraph.proto.RuntimeEnvList)1 PropertyValueResult (com.alibaba.maxgraph.result.PropertyValueResult)1