code: public Collection<CompletableFuture<Execution>> allocateResourcesForAll(
  			SlotProvider resourceProvider,
  			boolean queued,
  			LocationPreferenceConstraint locationPreferenceConstraint,
  			@Nonnull Set<AllocationID> allPreviousExecutionGraphAllocationIds,
  			Time allocationTimeout) {
  		final ExecutionVertex[] vertices = this.taskVertices;
  
  		@SuppressWarnings("unchecked")
  		final CompletableFuture<Execution>[] slots = new CompletableFuture[vertices.length];
  
  		// try to acquire a slot future for each execution.
  		// we store the execution with the future just to be on the safe side
  		for (int i = 0; i < vertices.length; i++) {
  			// allocate the next slot (future)
  			final Execution exec = vertices[i].getCurrentExecutionAttempt();
  			final CompletableFuture<Execution> allocationFuture = exec.allocateAndAssignSlotForExecution(
  				resourceProvider,
  				queued,
  				locationPreferenceConstraint,
  				allPreviousExecutionGraphAllocationIds,
  				allocationTimeout);
  			slots[i] = allocationFuture;
  		}
  
  		// all good, we acquired all slots
  		return Arrays.asList(slots);
  	}
docs: Acquires a slot for all the execution vertices of this ExecutionJobVertex. The method returns
  pairs of the slots and execution attempts, to ease correlation between vertices and execution
  attempts.
  
  <p>If this method throws an exception, it makes sure to release all so far requested slots.
  
  @param resourceProvider The resource provider from whom the slots are requested.
  @param queued if the allocation can be queued
  @param locationPreferenceConstraint constraint for the location preferences
  @param allPreviousExecutionGraphAllocationIds the allocation ids of all previous executions in the execution job graph.
  @param allocationTimeout timeout for allocating the individual slots