class AbstractYarnScheduler extends AbstractService implements ResourceScheduler {

  public synchronized void updateNodeResource(RMNode nm, 
      ResourceOption resourceOption) {
    SchedulerNode node = getSchedulerNode(nm.getNodeID());
    Resource newResource = resourceOption.getResource();
    Resource oldResource = node.getTotalResource();
    if(!oldResource.equals(newResource)) {
      // Log resource change
      LOG.info("Update resource on node: " + node.getNodeName()
          + " from: " + oldResource + ", to: "
          + newResource);

      nodes.remove(nm.getNodeID());
      updateMaximumAllocation(node, false);

      // update resource to node
      node.setTotalResource(newResource);

      nodes.put(nm.getNodeID(), (N)node);
      updateMaximumAllocation(node, true);

      // update resource to clusterResource
      Resources.subtractFrom(clusterResource, oldResource);
      Resources.addTo(clusterResource, newResource);
    } else {
      // Log resource change
      LOG.warn("Update resource on node: " + node.getNodeName() 
          + " with the same resource: " + newResource);
    }
  }

  public  AbstractYarnScheduler(String name);

}