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

Examples of com.taobao.zeus.socket.protocol.Protocol.Request.toByteString()


    final String jobId=history.getJobId();
    holder.getRunnings().put(jobId,false);
    ExecuteMessage em=ExecuteMessage.newBuilder().setJobId(jobId).build();
    final Request req=Request.newBuilder().setRid(AtomicIncrease.getAndIncrement()).setOperate(Operate.Schedule)
      .setBody(em.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);
        context.getHandler().addListener(new ResponseListener() {
View Full Code Here


    // 响应失败,返回失败退出码
    holder.getManualRunnings().put(historyId,false);
    ManualMessage mm=ManualMessage.newBuilder().setHistoryId(historyId).build();
    final Request req=Request.newBuilder().setRid(AtomicIncrease.getAndIncrement()).setOperate(Operate.Manual)
      .setBody(mm.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);
        context.getHandler().addListener(new ResponseListener() {
View Full Code Here

    // 响应失败,返回失败退出码
    holder.getDebugRunnings().put(id,false);
    DebugMessage dm=DebugMessage.newBuilder().setDebugId(id).build();
    final Request req=Request.newBuilder().setRid(AtomicIncrease.getAndIncrement()).setOperate(Operate.Debug)
      .setBody(dm.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);
        context.getHandler().addListener(new ResponseListener() {
View Full Code Here

    // 如果在等待队列,从等待队列删除
    // 如果都不在,抛出异常
    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);
        context.getHandler().addListener(new ResponseListener() {
View Full Code Here

      .addAllManualRunnings(context.getManualRunnings().keySet())
      .addAllRunnings(context.getRunnings().keySet())
      .setTimestamp(new Date().getTime()).build();
    Request req=Request.newBuilder().setRid(AtomicIncrease.getAndIncrement()).setOperate(Operate.HeartBeat).setBody(hbm.toByteString()).build();
   
    SocketMessage sm=SocketMessage.newBuilder().setKind(Kind.REQUEST).setBody(req.toByteString()).build();
    return context.getServerChannel().write(sm);
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.