Package com.taobao.zeus.socket.protocol.Protocol

Examples of com.taobao.zeus.socket.protocol.Protocol.CancelMessage


 
  public Future<Response> cancel(final MasterContext context,Channel channel,ExecuteKind ek,String id){
    // 如果在运行中 从worker列表中查询正在运行该job的woker,发出取消命令
    // 如果在等待队列,从等待队列删除
    // 如果都不在,抛出异常
    CancelMessage cm=CancelMessage.newBuilder().setEk(ek).setId(id).build();
    final Request req=Request.newBuilder().setRid(AtomicIncrease.getAndIncrement()).setOperate(Operate.Cancel)
      .setBody(cm.toByteString()).build();
    SocketMessage sm=SocketMessage.newBuilder().setKind(Kind.REQUEST).setBody(req.toByteString()).build();
    Future<Response> f=context.getThreadPool().submit((new Callable<Response>() {
      private Response response;
      public Response call() throws Exception {
        final CountDownLatch latch=new CountDownLatch(1);
View Full Code Here


public class WorkerBeCancel {

  public Future<Response> execute(final WorkerContext context,final Request req){
    try {
      CancelMessage cm=CancelMessage.newBuilder().mergeFrom(req.getBody()).build();
      if(cm.getEk()==ExecuteKind.DebugKind){
        return cancelDebug(context, req,cm.getId());
      }else if(cm.getEk()==ExecuteKind.ManualKind){
        return cancelManual(context, req, cm.getId());
      }else if(cm.getEk()==ExecuteKind.ScheduleKind){
        return cancelSchedule(context, req,cm.getId());
      }
    } catch (InvalidProtocolBufferException e) {
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.taobao.zeus.socket.protocol.Protocol.CancelMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.