void incrementReservations ( TaskType type , int reservedSlots ) { if ( type . equals ( TaskType . MAP ) ) { reservedMapSlots += reservedSlots ; } else if ( type . equals ( TaskType . REDUCE ) ) { reservedReduceSlots += reservedSlots ; } }
This method assumes the caller has JobTracker lock .