public synchronized void sourceStateUpdated(String sourceName, VertexState sourceState) {
    SourceInfo sourceInfo = getSourceInfo(sourceName);
    // Update source info if the state is SUCCEEDED
    if (sourceState == VertexState.SUCCEEDED) {
      sourceInfo.numCompletedTasks = getVertexCompletedTaskCount(sourceName);
      sourceInfo.numTasks = getVertexTotalTaskCount(sourceName);
    }
    sourceInfo.lastKnownState = sourceState;
    // Checking state per node for future failure handling scenarios, where an update
    // to a single node may fail.
    for (LlapNodeId nodeId : sourceInfo.getInterestedNodes()) {
      NodeInfo nodeInfo = nodeInfoMap.get(nodeId);
      VertexState lastStateForNode = nodeInfo.getLastKnownStateForSource(sourceName);
      // Send only if the state has changed.
      if (lastStateForNode != sourceState) {
        nodeInfo.setLastKnownStateForSource(sourceName, sourceState);
        sendStateUpdateToNode(nodeId, sourceName, sourceState);
      }
    }
  }
Handled notifications on state updates for sources
@param sourceName
@param sourceState
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/helpers/SourceStateTracker.java