private void handleFragmentCompleteExternalQuery(QueryInfo queryInfo) {
    if (queryInfo.isExternalQuery()) {
      ReadWriteLock dagLock = getDagLock(queryInfo.getQueryIdentifier());
      if (dagLock == null) {
        LOG.warn("Ignoring fragment completion for unknown query: {}",
            queryInfo.getQueryIdentifier());
      }
      boolean locked = dagLock.writeLock().tryLock();
      if (!locked) {
        // Some other operation in progress using the same lock.
        // A subsequent fragmentComplete is expected to come in.
        return;
      }
      try {
         if (queryInfo.getRegisteredFragments().size() == 0) {
           queryComplete(queryInfo.getQueryIdentifier(), -1, true);
         } else {
           if (LOG.isTraceEnabled()) {
             LOG.trace(
                 "Not invoking queryComplete on fragmentComplete for {}, since there are known fragments. count={}",
                 queryInfo.getHiveQueryIdString(), queryInfo.getRegisteredFragments().size());
           }
         }
      } catch (IOException e) {
        LOG.error("Failed to process query complete for external submission: {}",
            queryInfo.getQueryIdentifier());
      } finally {
        dagLock.writeLock().unlock();
      }
    }
  }
Register an update to a source within an executing dag
@param queryIdentifier
@param sourceName
@param sourceState
llap-server/src/java/org/apache/hadoop/hive/llap/daemon/impl/QueryTracker.java