private boolean incSlotLimit ( JobInfo info , TaskType type , LimitType limit ) { switch ( limit ) { case MIN : if ( type == TaskType . MAP ) { if ( info . minMaps < runnableTasks ( info , type ) ) { info . minMaps += 1 ; return true ; } } else { if ( info . minReduces < runnableTasks ( info , type ) ) { info . minReduces += 1 ; return true ; } } return false ; case MAX : if ( type == TaskType . MAP ) { if ( info . maxMaps < runnableTasks ( info , type ) ) { info . maxMaps += 1 ; return true ; } } else { if ( info . maxReduces < runnableTasks ( info , type ) ) { info . maxReduces += 1 ; return true ; } } return false ; } // Never come here return false ; }
Increment the slot limit of a job