xintongsong commented on a change in pull request #11615: [FLINK-16605] Add max 
limitation to the total number of slots
URL: https://github.com/apache/flink/pull/11615#discussion_r402736479
 
 

 ##########
 File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerImplTest.java
 ##########
 @@ -1293,7 +1293,18 @@ private SlotRequest createSlotRequest(JobID jobId, 
ResourceProfile resourceProfi
        }
 
        private SlotManagerImpl createSlotManager(ResourceManagerId 
resourceManagerId, ResourceActions resourceManagerActions) {
-               SlotManagerImpl slotManager = 
SlotManagerBuilder.newBuilder().build();
+               return createSlotManager(resourceManagerId, 
resourceManagerActions, 1);
+       }
+
+       private SlotManagerImpl createSlotManager(ResourceManagerId 
resourceManagerId, ResourceActions resourceManagerActions, int 
numSlotsPerWorker) {
+               return createSlotManager(resourceManagerId, 
resourceManagerActions, numSlotsPerWorker, Integer.MAX_VALUE);
+       }
+
+       private SlotManagerImpl createSlotManager(ResourceManagerId 
resourceManagerId, ResourceActions resourceManagerActions, int 
numSlotsPerWorker, int maxSlotNum) {
 
 Review comment:
   I think we should try to avoid such deep nested methods if possible.
   Since both `numSlotsPerWorker` and `maxSlotNum` can be read from a 
`Configuration`, I think keeping only two `createSlotManager` methods (one with 
`Configuration` and one without) should be enough.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to