xintongsong commented on a change in pull request #14560: URL: https://github.com/apache/flink/pull/14560#discussion_r553190497
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/taskexecutor/slot/TaskSlotTableImpl.java ########## @@ -349,6 +345,28 @@ public boolean allocateSlot( return true; } + private boolean isDuplicatedSlot( + TaskSlot taskSlot, JobID jobId, ResourceProfile resourceProfile, int index) { + LOG.info( + "Slot with allocationId {} already exist, with resource profile {}, job id {} and index {}. The required index is {}.", + taskSlot.getAllocationId(), + taskSlot.getResourceProfile(), + taskSlot.getJobId(), + taskSlot.getIndex(), + index); + return taskSlot.getJobId().equals(jobId) + && taskSlot.getResourceProfile().equals(resourceProfile) + && (isDynamicIndex(index) || taskSlot.getIndex() == index); + } + + private boolean isIndexAlreadyTaken(int index) { + return !isDynamicIndex(index) && taskSlots.get(index) != null; Review comment: Is `!isDynamicIndex(index)` necessary. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to 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