public int getNumberOfAvailableSlotsForGroup ( AbstractID groupId ) { synchronized ( lock ) { Map < ResourceID , List < SharedSlot > > available = availableSlotsPerJid . get ( groupId ) ; if ( available != null ) { Set < SharedSlot > set = new HashSet < SharedSlot > ( ) ; for ( List < SharedSlot > list : available . values ( ) ) { for ( SharedSlot slot : list ) { set . add ( slot ) ; } } return set . size ( ) ; } else { // if no entry exists for a JobVertexID so far, then the vertex with that ID can // add a subtask into each shared slot of this group. Consequently, all // of them are available for that JobVertexID. return allSlots . size ( ) ; } } }
Gets the number of shared slots into which the given group can place subtasks or nested task groups .