tillrohrmann commented on a change in pull request #6898: [FLINK-10431] Extraction of scheduling-related code from SlotPool into preliminary Scheduler URL: https://github.com/apache/flink/pull/6898#discussion_r227870899
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotPool.java ########## @@ -822,6 +835,29 @@ private SlotAndLocality pollAndAllocateSlot(SlotRequestId slotRequestId, SlotPro return slotFromPool; } + @Nullable + private AllocatedSlot allocateSlotWithID(@Nonnull SlotRequestId slotRequestId, @Nonnull AllocationID allocationID) { + AllocatedSlot allocatedSlot = availableSlots.tryRemove(allocationID); + if (allocatedSlot != null) { + allocatedSlots.add(slotRequestId, allocatedSlot); + } + return allocatedSlot; + } + + @Override + @Nullable + public AllocatedSlot allocateAvailableSlot( Review comment: Could think of whether to make it an `Optional` to make it more explicit that this might not succeed. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services