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 ) ; } } } } }
Add a node to be managed .