Source:
<code>public List<SlotExecutionVertexAssignment> allocateSlotsFor( List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { validateSchedulingRequirements(executionVertexSchedulingRequirements); List<SlotExecutionVertexAssignment> slotExecutionVertexAssignments = new ArrayList<>(executionVertexSchedulingRequirements.size()); Set<AllocationID> allPreviousAllocationIds = computeAllPriorAllocationIds(executionVertexSchedulingRequirements); for (ExecutionVertexSchedulingRequirements schedulingRequirements : executionVertexSchedulingRequirements) { final ExecutionVertexID executionVertexId = schedulingRequirements.getExecutionVertexId(); final SlotRequestId slotRequestId = new SlotRequestId(); final SlotSharingGroupId slotSharingGroupId = schedulingRequirements.getSlotSharingGroupId(); <START> LOG.debug("Allocate slot with id for execution {}", slotRequestId, executionVertexId); final CompletableFuture<SlotProfile> slotProfileFuture = getSlotProfileFuture( schedulingRequirements, schedulingRequirements.getPhysicalSlotResourceProfile(), Collections.emptySet(), allPreviousAllocationIds); final CompletableFuture<LogicalSlot> slotFuture = slotProfileFuture.thenCompose( slotProfile -> slotProviderStrategy.allocateSlot( slotRequestId, new ScheduledUnit( executionVertexId, slotSharingGroupId, schedulingRequirements.getCoLocationConstraint()), slotProfile)); <END> final SlotExecutionVertexAssignment slotExecutionVertexAssignment = createAndRegisterSlotExecutionVertexAssignment( executionVertexId, slotFuture, (requestId, throwable) -> slotProviderStrategy.cancelSlotRequest(requestId, slotSharingGroupId, throwable)); slotExecutionVertexAssignments.add(slotExecutionVertexAssignment); } return slotExecutionVertexAssignments; }</code><technical_language>nit, nice have: private CompletableFuture<LogicalSlot> allocateSlot( Set<AllocationID> allPreviousAllocationIds, ExecutionVertexSchedulingRequirements schedulingRequirements) { final ExecutionVertexID executionVertexId = schedulingRequirements.getExecutionVertexId(); final SlotRequestId slotRequestId = new SlotRequestId(); LOG.debug("Allocate slot id for execution {}", slotRequestId, executionVertexId); final CompletableFuture<SlotProfile> slotProfileFuture = getSlotProfileFuture( schedulingRequirements, schedulingRequirements.getPhysicalSlotResourceProfile(), Collections.emptySet(), allPreviousAllocationIds); return slotProfileFuture.thenCompose( slotProfile -> slotProviderStrategy.allocateSlot( slotRequestId, new ScheduledUnit( executionVertexId, schedulingRequirements.getSlotSharingGroupId(), schedulingRequirements.getCoLocationConstraint()), slotProfile)); }</technical_language>

Target:
public List<SlotExecutionVertexAssignment> allocateSlotsFor( List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { validateSchedulingRequirements(executionVertexSchedulingRequirements); List<SlotExecutionVertexAssignment> slotExecutionVertexAssignments = new ArrayList<>(executionVertexSchedulingRequirements.size()); Set<AllocationID> allPreviousAllocationIds = computeAllPriorAllocationIds(executionVertexSchedulingRequirements); for (ExecutionVertexSchedulingRequirements schedulingRequirements : executionVertexSchedulingRequirements) { final ExecutionVertexID executionVertexId = schedulingRequirements.getExecutionVertexId(); final SlotSharingGroupId slotSharingGroupId = schedulingRequirements.getSlotSharingGroupId(); final SlotRequestId slotRequestId = new SlotRequestId(); final CompletableFuture<LogicalSlot> slotFuture = allocateSlot( schedulingRequirements, slotRequestId, allPreviousAllocationIds); final SlotExecutionVertexAssignment slotExecutionVertexAssignment = createAndRegisterSlotExecutionVertexAssignment( executionVertexId, slotFuture, throwable -> slotProviderStrategy.cancelSlotRequest(slotRequestId, slotSharingGroupId, throwable)); slotExecutionVertexAssignments.add(slotExecutionVertexAssignment); } return slotExecutionVertexAssignments; }