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

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


    new Thread(){
      public void run() {
        while(true){
          try {
            Future<Response> f=completionService.take();
            Response resp=f.get();
            if(context.getServerChannel()!=null){
              context.getServerChannel().write(wapper(resp));
            }
          } catch (Exception e) {
            ScheduleInfoLog.error("take future", e);
View Full Code Here


            return cancel.execute(context, request).get();
          }
        });
      }
    }else if(sm.getKind()==Kind.RESPONSE){
      final Response resp=Response.newBuilder().mergeFrom(sm.getBody()).build();
      for(ResponseListener lis:listeners){
        lis.onResponse(resp);
      }
    }else if(sm.getKind()==Kind.WEB_RESPONSE){
      final WebResponse resp=WebResponse.newBuilder().mergeFrom(sm.getBody()).build();
View Full Code Here

            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
                .format(new Date()) + " 开始运行");
        context.getDebugHistoryManager().updateDebugHistoryLog(debugId,
            history.getLog().getContent());
        Exception exception = null;
        Response resp = null;
        try {
          Future<Response> f = new MasterExecuteJob().executeJob(
              context, w, ExecuteKind.DebugKind, debugId);
          resp = f.get();
        } catch (Exception e) {
          exception = e;
          DebugInfoLog.error(
              String.format("debugId:%s run failed", debugId), e);
        }
        boolean success = resp.getStatus() == Status.OK ? true : false;

        if (!success) {
          // 运行失败,更新失败状态,发出失败消息
          if (exception != null) {
            exception = new ZeusException(String.format(
View Full Code Here

            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
                .format(new Date()) + " 开始运行");
        context.getJobHistoryManager().updateJobHistoryLog(historyId,
            history.getLog().getContent());
        Exception exception = null;
        Response resp = null;
        try {
          Future<Response> f = new MasterExecuteJob().executeJob(
              context, w, ExecuteKind.ManualKind, historyId);
          resp = f.get();
        } catch (Exception e) {
          exception = e;
          ScheduleInfoLog.error("JobId:" + history.getJobId()
              + " run failed", e);
        }
        boolean success = resp.getStatus() == Status.OK ? true : false;

        if (!success) {
          // 运行失败,更新失败状态,发出失败消息
          ZeusJobException jobException = null;
          if (exception != null) {
View Full Code Here

            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
                .format(new Date()) + " 开始运行");
        context.getJobHistoryManager().updateJobHistoryLog(his.getId(),
            his.getLog().getContent());
        Exception exception = null;
        Response resp = null;
        try {
          Future<Response> f = new MasterExecuteJob().executeJob(
              context, w, ExecuteKind.ScheduleKind, his.getId());
          resp = f.get();
        } catch (Exception e) {
          exception = e;
          ScheduleInfoLog.error(
              String.format("JobId:%s run failed", jobId), e);
        }
        boolean success = resp.getStatus() == Status.OK ? true : false;

        JobStatus jobstatus = context.getGroupManager().getJobStatus(
            jobId);
        jobstatus
            .setStatus(com.taobao.zeus.model.JobStatus.Status.WAIT);
View Full Code Here

      });
    }
    return context.getThreadPool().submit(new Callable<Response>() {
      public Response call() throws Exception {
        context.getClientWorker().cancelManualJob(historyId);
        Response resp=Response.newBuilder().setRid(req.getRid()).setOperate(Operate.Cancel).setStatus(Status.OK).build();
        return resp;
      }
    });
  }
View Full Code Here

      });
    }
    return context.getThreadPool().submit(new Callable<Response>() {
      public Response call() throws Exception {
        context.getClientWorker().cancelScheduleJob(jobId);
        Response resp=Response.newBuilder().setRid(req.getRid()).setOperate(Operate.Cancel).setStatus(Status.OK).build();
        return resp;
      }
    });
  }
View Full Code Here

    }else{
      SocketLog.info("send cancel debug response to worker,rid="+req.getRid()+",debugId="+debugId);
      future= context.getThreadPool().submit(new Callable<Response>() {
        public Response call() throws Exception {
          context.getClientWorker().cancelDebugJob(debugId);
          Response resp=Response.newBuilder().setRid(req.getRid()).setOperate(Operate.Cancel).setStatus(Status.OK).build();
          return resp;
        }
      });
    }
    return future;
View Full Code Here

              status = Status.ERROR;
            }
            if (exception != null && exception.getMessage() != null) {
              errorText = exception.getMessage();
            }
            Response resp = Response.newBuilder().setRid(
                req.getRid()).setOperate(Operate.Manual)
                .setStatus(status).setErrorText(errorText)
                .build();
            SocketLog
                .info("send manual response,manual complete,rid="
View Full Code Here

              status = Status.ERROR;
            }
            if (exception != null && exception.getMessage() != null) {
              errorText = exception.getMessage();
            }
            Response resp = Response.newBuilder().setRid(
                req.getRid()).setOperate(Operate.Debug)
                .setStatus(status).setErrorText(errorText)
                .build();
            SocketLog
                .info("send debug response,debug complete,rid="
View Full Code Here

TOP

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

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.