code: public Collection<CompletableFuture<TaskManagerLocation>> getPreferredLocations() {
  		Collection<CompletableFuture<TaskManagerLocation>> basedOnState = getPreferredLocationsBasedOnState();
  		return basedOnState != null ? basedOnState : getPreferredLocationsBasedOnInputs();
  	}
docs: Gets the overall preferred execution location for this vertex's current execution.
  The preference is determined as follows:
  
  <ol>
  <li>If the task execution has state to load (from a checkpoint), then the location preference
  is the location of the previous execution (if there is a previous execution attempt).
  <li>If the task execution has no state or no previous location, then the location preference
  is based on the task's inputs.
  </ol>
  
  <p>These rules should result in the following behavior:
  
  <ul>
  <li>Stateless tasks are always scheduled based on co-location with inputs.
  <li>Stateful tasks are on their initial attempt executed based on co-location with inputs.
  <li>Repeated executions of stateful tasks try to co-locate the execution with its state.
  </ul>
  
  @see #getPreferredLocationsBasedOnState()
  @see #getPreferredLocationsBasedOnInputs()
  
  @return The preferred execution locations for the execution attempt.