code: public boolean allocateSlot(int index, JobID jobId, AllocationID allocationId, Time slotTimeout) {
  		checkInit();
  
  		TaskSlot taskSlot = taskSlots.get(index);
  
  		boolean result = taskSlot.allocate(jobId, allocationId);
  
  		if (result) {
  			// update the allocation id to task slot map
  			allocationIDTaskSlotMap.put(allocationId, taskSlot);
  
  			// register a timeout for this slot since it's in state allocated
  			timerService.registerTimeout(allocationId, slotTimeout.getSize(), slotTimeout.getUnit());
  
  			// add this slot to the set of job slots
  			Set<AllocationID> slots = slotsPerJob.get(jobId);
  
  			if (slots == null) {
  				slots = new HashSet<>(4);
  				slotsPerJob.put(jobId, slots);
  			}
  
  			slots.add(allocationId);
  		}
  
  		return result;
  	}
docs: Allocate the slot with the given index for the given job and allocation id. Returns true if
  the slot could be allocated. Otherwise it returns false.
  
  @param index of the task slot to allocate
  @param jobId to allocate the task slot for
  @param allocationId identifying the allocation
  @param slotTimeout until the slot times out
  @return True if the task slot could be allocated; otherwise false