huwh commented on code in PR #23201:
URL: https://github.com/apache/flink/pull/23201#discussion_r1330170577
##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerConfiguration.java:
##########
@@ -30,16 +30,11 @@
import org.apache.flink.util.ConfigurationException;
import org.apache.flink.util.Preconditions;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
+import java.math.RoundingMode;
import java.time.Duration;
/** Configuration for the {@link SlotManager}. */
public class SlotManagerConfiguration {
-
Review Comment:
Can we move the removal of unused code into a 'hotfix' commit? It's not
related to the main logic.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerConfiguration.java:
##########
@@ -78,15 +79,93 @@ public SlotManagerConfiguration(
this.evenlySpreadOutSlots = evenlySpreadOutSlots;
this.defaultWorkerResourceSpec =
Preconditions.checkNotNull(defaultWorkerResourceSpec);
Preconditions.checkState(numSlotsPerWorker > 0);
- Preconditions.checkState(maxSlotNum > 0);
this.numSlotsPerWorker = numSlotsPerWorker;
+ if (minSlotNum > 0) {
+ checkSlotNumResource(minSlotNum, maxSlotNum,
defaultWorkerResourceSpec);
+ }
+ if (!minTotalCpu.isZero()) {
Review Comment:
ditto
##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerConfiguration.java:
##########
@@ -78,15 +79,93 @@ public SlotManagerConfiguration(
this.evenlySpreadOutSlots = evenlySpreadOutSlots;
this.defaultWorkerResourceSpec =
Preconditions.checkNotNull(defaultWorkerResourceSpec);
Preconditions.checkState(numSlotsPerWorker > 0);
- Preconditions.checkState(maxSlotNum > 0);
this.numSlotsPerWorker = numSlotsPerWorker;
+ if (minSlotNum > 0) {
+ checkSlotNumResource(minSlotNum, maxSlotNum,
defaultWorkerResourceSpec);
+ }
+ if (!minTotalCpu.isZero()) {
+ checkTotalCPUResource(minTotalCpu, maxTotalCpu,
defaultWorkerResourceSpec);
+ }
+ if (minTotalMem.compareTo(MemorySize.ZERO) > 0) {
Review Comment:
ditto
##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerConfiguration.java:
##########
@@ -78,15 +79,93 @@ public SlotManagerConfiguration(
this.evenlySpreadOutSlots = evenlySpreadOutSlots;
this.defaultWorkerResourceSpec =
Preconditions.checkNotNull(defaultWorkerResourceSpec);
Preconditions.checkState(numSlotsPerWorker > 0);
- Preconditions.checkState(maxSlotNum > 0);
this.numSlotsPerWorker = numSlotsPerWorker;
+ if (minSlotNum > 0) {
Review Comment:
We always check whether maxSlotNum is larger than zero before. After this
if-branch, we only check it when minSlotNum is larger than zero.
We should move the if-check into the `checkSlotNumResource`.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]