Beispiel #1
0
  public void reportQueryStatusToQueryMaster(QueryId queryId, TajoProtos.QueryState state) {
    LOG.info("Send QueryMaster Ready to QueryJobManager:" + queryId);
    NettyClientBase tmClient = null;
    try {
      tmClient =
          connPool.getConnection(
              queryMasterContext.getWorkerContext().getTajoMasterAddress(),
              TajoMasterProtocol.class,
              true);
      TajoMasterProtocol.TajoMasterProtocolService masterClientService = tmClient.getStub();

      TajoHeartbeat.Builder queryHeartbeatBuilder =
          TajoHeartbeat.newBuilder()
              .setTajoWorkerHost(
                  workerContext.getQueryMasterManagerService().getBindAddr().getHostName())
              .setTajoQueryMasterPort(
                  workerContext.getQueryMasterManagerService().getBindAddr().getPort())
              .setTajoWorkerClientPort(
                  workerContext.getTajoWorkerClientService().getBindAddr().getPort())
              .setState(state)
              .setQueryId(queryId.getProto());

      CallFuture<TajoHeartbeatResponse> callBack = new CallFuture<TajoHeartbeatResponse>();

      masterClientService.heartbeat(
          callBack.getController(), queryHeartbeatBuilder.build(), callBack);
    } catch (Exception e) {
      LOG.error(e.getMessage(), e);
    } finally {
      connPool.releaseConnection(tmClient);
    }
  }
Beispiel #2
0
 private TajoHeartbeat buildTajoHeartBeat(QueryMasterTask queryMasterTask) {
   TajoHeartbeat queryHeartbeat =
       TajoHeartbeat.newBuilder()
           .setTajoWorkerHost(
               workerContext.getQueryMasterManagerService().getBindAddr().getHostName())
           .setTajoQueryMasterPort(
               workerContext.getQueryMasterManagerService().getBindAddr().getPort())
           .setTajoWorkerClientPort(
               workerContext.getTajoWorkerClientService().getBindAddr().getPort())
           .setState(queryMasterTask.getState())
           .setQueryId(queryMasterTask.getQueryId().getProto())
           .setQueryProgress(queryMasterTask.getQuery().getProgress())
           .setQueryFinishTime(queryMasterTask.getQuery().getFinishTime())
           .build();
   return queryHeartbeat;
 }