docs: private void registerSlot(
  			SlotID slotId,
  			AllocationID allocationId,
  			JobID jobId,
  			ResourceProfile resourceProfile,
  			TaskExecutorConnection taskManagerConnection) {
  
  		if (slots.containsKey(slotId)) {
  			// remove the old slot first
  			removeSlot(slotId);
  		}
  
  		final TaskManagerSlot slot = createAndRegisterTaskManagerSlot(slotId, resourceProfile, taskManagerConnection);
  
  		final PendingTaskManagerSlot pendingTaskManagerSlot;
  
  		if (allocationId == null) {
  			pendingTaskManagerSlot = findExactlyMatchingPendingTaskManagerSlot(resourceProfile);
  		} else {
  			pendingTaskManagerSlot = null;
  		}
  
  		if (pendingTaskManagerSlot == null) {
  			updateSlot(slotId, allocationId, jobId);
  		} else {
  			pendingSlots.remove(pendingTaskManagerSlot.getTaskManagerSlotId());
  			final PendingSlotRequest assignedPendingSlotRequest = pendingTaskManagerSlot.getAssignedPendingSlotRequest();
  
  			if (assignedPendingSlotRequest == null) {
  				handleFreeSlot(slot);
  			} else {
  				assignedPendingSlotRequest.unassignPendingTaskManagerSlot();
  				allocateSlot(slot, assignedPendingSlotRequest);
  			}
  		}
  	}