code: public void unregisterTaskManager(InstanceID instanceId, boolean terminated){
  		Instance instance = registeredHostsById.get(instanceId);
  
  		if (instance != null){
  			registeredHostsById.remove(instance.getId());
  			registeredHostsByResource.remove(instance.getTaskManagerID());
  
  			if (terminated) {
  				deadHosts.add(instance.getTaskManagerID());
  			}
  
  			instance.markDead();
  
  			totalNumberOfAliveTaskSlots -= instance.getTotalNumberOfSlots();
  
  			notifyDeadInstance(instance);
  
  			LOG.info(
  				"Unregistered task manager " + instance.getTaskManagerLocation().addressString() +
  				". Number of registered task managers " + getNumberOfRegisteredTaskManagers() +
  				". Number of available slots " + getTotalNumberOfSlots() + ".");
  		} else {
  			LOG.warn("Tried to unregister instance {} but it is not registered.", instanceId);
  		}
  	}
docs: Unregisters the TaskManager with the given instance id. Unregistering means to mark
  the given instance as dead and notify {@link InstanceListener} about the dead instance.
  
  @param instanceId TaskManager which is about to be marked dead.