public synchronized void registerTaskForStateUpdates(String host, int port,
                                                       List<InputSpec> inputSpecList) {

    // Add tracking information. Check if source state already known and send out an update if it is.

    List<String> sourcesOfInterest = getSourceInterestList(inputSpecList);
    if (sourcesOfInterest != null && !sourcesOfInterest.isEmpty()) {
      LlapNodeId nodeId = LlapNodeId.getInstance(host, port);
      NodeInfo nodeInfo = getNodeInfo(nodeId);

      // Set up the data structures, before any notifications come in.
      for (String src : sourcesOfInterest) {
        VertexState oldStateForNode = nodeInfo.getLastKnownStateForSource(src);
        if (oldStateForNode == null) {
          // Not registered for this node.
          // Register and send state if it is successful.
          SourceInfo srcInfo = getSourceInfo(src);
          srcInfo.addNode(nodeId);

          nodeInfo.addSource(src, srcInfo.lastKnownState);
          if (srcInfo.lastKnownState == VertexState.SUCCEEDED) {
            sendStateUpdateToNode(nodeId, src, srcInfo.lastKnownState);
          }

        } else {
          // Already registered to send updates to this node for the specific source.
          // Nothing to do for now, unless tracking tasks at a later point.
        }

        // Setup for actual notifications, if not already done for a previous task.
        maybeRegisterForVertexUpdates(src);
      }
    } else {
      // Don't need to track anything for this task. No new notifications, etc.
    }
  }
Used to register a task for state updates. Effectively registers for state updates to go to the specific node.
@param host
@param port
@param inputSpecList
llap-tez/src/java/org/apache/hadoop/hive/llap/tezplugins/helpers/SourceStateTracker.java