public void addNewGrants ( List < ResourceGrant > grants ) { int numGranted = 0 ; int numAvailable = 0 ; synchronized ( lockObject ) { for ( ResourceGrant grant : grants ) { Integer requestId = grant . getId ( ) ; if ( ! requestedResources . containsKey ( requestId ) || ! requestMap . containsKey ( requestId ) ) { LOG . info ( "Request for grant " + grant . getId ( ) + " no longer exists" ) ; continue ; } assert ! grantedResources . containsKey ( grant . getId ( ) ) : "Grant " + grant . getId ( ) + " has already been processed." ; updateTrackerAddressUnprotected ( grant ) ; addGrantedResourceUnprotected ( grant ) ; } updateGrantStatsUnprotected ( ) ; numGranted = grantedResources . size ( ) ; numAvailable = availableResources . size ( ) ; lockObject . notify ( ) ; } LOG . info ( "Number of available grants: " + numAvailable + " out of " + numGranted ) ; }
Obtained new grants from Cluster Manager .