class DefaultPreferredLocationsRetriever implements PreferredLocationsRetriever {

	@Override
	public CompletableFuture<Collection<TaskManagerLocation>> getPreferredLocations(
			final ExecutionVertexID executionVertexId,
			final Set<ExecutionVertexID> producersToIgnore) {

		checkNotNull(executionVertexId);
		checkNotNull(producersToIgnore);

		final Collection<TaskManagerLocation> preferredLocationsBasedOnState =
			getPreferredLocationsBasedOnState(executionVertexId);
		if (!preferredLocationsBasedOnState.isEmpty()) {
			return CompletableFuture.completedFuture(preferredLocationsBasedOnState);
		}

		return getPreferredLocationsBasedOnInputs(executionVertexId, producersToIgnore);
	}

	  DefaultPreferredLocationsRetriever(
			final StateLocationRetriever stateLocationRetriever,
			final InputsLocationsRetriever inputsLocationsRetriever);

}