code: protected void addAppToNode(
        ClusterNode node, ResourceType type, String appInfo) {
      synchronized (node) {
        // Update primary index.
        Map<ResourceType, String> apps = nameToApps.get(node.getName());
        apps.put(type, appInfo);
  
        // Update runnable indices.
        for (Map.Entry<ResourceType, RunnableIndices> entry :
            typeToIndices.entrySet()) {
          if (type.equals(entry.getKey())) {
            if (node.checkForGrant(Utilities.getUnitResourceRequest(type),
                                    resourceLimit)) {
              RunnableIndices r = entry.getValue();
              r.addRunnable(node);
            }
          }
        }
      }
    }
docs: Register a new application on the node
  @param node the node to register on
  @param type the type of an application
  @param appInfo the appInfo string for the application