public boolean addGrant ( ClusterNode node , String sessionId , ResourceRequestInfo req ) { synchronized ( node ) { if ( node . deleted ) { return false ; } if ( ! node . checkForGrant ( Utilities . getUnitResourceRequest ( req . getType ( ) ) , resourceLimit ) ) { return false ; } node . addGrant ( sessionId , req ) ; loadManager . incrementLoad ( req . getType ( ) ) ; hostsToSessions . get ( node ) . add ( sessionId ) ; if ( ! node . checkForGrant ( Utilities . getUnitResourceRequest ( req . getType ( ) ) , resourceLimit ) ) { RunnableIndices r = typeToIndices . get ( req . getType ( ) ) ; r . deleteRunnable ( node ) ; } } return true ; }
Add a grant to a node