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 ) ; } } } } }
Register a new application on the node