KarmaGYZ commented on a change in pull request #11615:
URL: https://github.com/apache/flink/pull/11615#discussion_r411093074



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerConfiguration.java
##########
@@ -64,7 +66,9 @@ public SlotManagerConfiguration(
                this.slotMatchingStrategy = 
Preconditions.checkNotNull(slotMatchingStrategy);
                this.defaultWorkerResourceSpec = 
Preconditions.checkNotNull(defaultWorkerResourceSpec);
                Preconditions.checkState(numSlotsPerWorker > 0);
+               Preconditions.checkState(maxSlotNum > 0);
                this.numSlotsPerWorker = numSlotsPerWorker;
+               this.maxSlotNum = maxSlotNum;

Review comment:
       I think the semantic of "Preconditions" is to do the sanity check before 
the assign operation. So, it's a bit weird to move them to the end of the 
function.




----------------------------------------------------------------
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


Reply via email to