private void computeUpstreamTaskCounts(MutableInt completedTaskCount, MutableInt totalTaskCount, String sourceName) {
    SourceInfo sourceInfo = getSourceInfo(sourceName);
    if (sourceInfo.lastKnownState == VertexState.SUCCEEDED) {
      // Some of the information in the source is complete. Don't need to fetch it from the context.
      completedTaskCount.add(sourceInfo.numCompletedTasks);
      totalTaskCount.add(sourceInfo.numTasks);
    } else {
      completedTaskCount.add(getVertexCompletedTaskCount(sourceName));
      int totalCount = getVertexTotalTaskCount(sourceName);

      // Uninitialized vertices will report count as 0.
      totalCount = totalCount == -1 ? 0 : totalCount;
      totalTaskCount.add(totalCount);
    }

    // Walk through all the source vertices
    for (String up : taskCommunicatorContext.getInputVertexNames(sourceName)) {
      computeUpstreamTaskCounts(completedTaskCount, totalTaskCount, up);
    }
  }
Constructs FragmentRuntimeInfo for scheduling within LLAP daemons.
Also caches state based on state updates.
@param vertexName
@param fragmentNumber
@param priority
@return
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/helpers/SourceStateTracker.java