public boolean registerDag(NodeInfo node, final OperationCallback<QueryIdentifierProto, Void> callback) {
    RegisterDagRequestProto.Builder builder = RegisterDagRequestProto.newBuilder();
    if (currentQueryIdentifierProto == null) {
      return false;
    }
    try {
      RegisterDagRequestProto request = builder
          .setQueryIdentifier(currentQueryIdentifierProto)
          .setUser(user)
          .setCredentialsBinary(
              getCredentials(getContext()
                  .getCurrentDagInfo().getCredentials())).build();
      communicator.registerDag(request, node.getHost(), node.getRpcPort(),
          new LlapProtocolClientProxy.ExecuteRequestCallback<RegisterDagResponseProto>() {
            @Override
            public void setResponse(RegisterDagResponseProto response) {
              callback.setDone(null, currentQueryIdentifierProto);
            }

            @Override
            public void indicateError(Throwable t) {
              LOG.info("Error registering dag with"
                  + " appId=" + currentQueryIdentifierProto.getApplicationIdString()
                  + " dagId=" + currentQueryIdentifierProto.getDagIndex()
                  + " to node " + node.getHost());
              processSendError(t);
              callback.setError(null, t);
            }
          });
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return true;
  }
@param node
@param callback
@return if it was possible to attempt the registration. Sometimes it's
not possible because is a dag is not running
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/LlapTaskCommunicator.java