code: protected void addNode(ClusterNode node,
                           Map<ResourceType, String> resourceInfos) {
      synchronized (node) {
        // 1: primary
        nameToNode.put(node.getName(), node);
        faultManager.addNode(node.getName(), resourceInfos.keySet());
        nameToApps.put(node.getName(), resourceInfos);
        hostsToSessions.put(node, new HashSet<String>());
        clusterManager.getMetrics().restartTaskTracker(1);
        setAliveDeadMetrics();
  
        // 2: update runnable indices
        for (Map.Entry<ResourceType, RunnableIndices> entry :
            typeToIndices.entrySet()) {
          ResourceType type = entry.getKey();
          if (resourceInfos.containsKey(type)) {
            if (node.checkForGrant(Utilities.getUnitResourceRequest(type),
                                   resourceLimit)) {
              RunnableIndices r = entry.getValue();
              r.addRunnable(node);
            }
          }
        }
      }
    }
docs: Add a node to be managed.
  
  @param node Node to be managed
  @param resourceInfos Mapping of the resource type to runnable indices