Github user tillrohrmann commented on a diff in the pull request:
https://github.com/apache/flink/pull/6208#discussion_r198420806
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java
---
@@ -280,12 +281,7 @@ public JobMaster(
resourceManagerLeaderRetriever =
highAvailabilityServices.getResourceManagerLeaderRetriever();
- this.slotPool = new SlotPool(
- rpcService,
- jobGraph.getJobID(),
- SystemClock.getInstance(),
- rpcTimeout,
- jobMasterConfiguration.getSlotIdleTimeout());
+ this.slotPool =
checkNotNull(slotPoolFactory).createSlotPool(jobGraph.getJobID());
--- End diff --
The reason why I introduced the factory is that we want to create a
`SlotPool` for the `JobID` of the given `JobGraph`. That way we enforce that
the `SlotPool` is strictly instantiated with the right `JobID`. If we move the
instantiation of the `SlotPool` out of the `JobMaster` we would have to rely on
the outside code. Therefore, I would like to keep it like it is.
---