GJL commented on a change in pull request #9675: [FLINK-13953] [runtime] 
Facilitate enabling new scheduler in MiniCluster Tests
URL: https://github.com/apache/flink/pull/9675#discussion_r326047014
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java
 ##########
 @@ -810,15 +812,24 @@ private void startHeartbeatServices() {
                        log);
        }
 
-       private void assignScheduler(
+       private void reassignScheduler(
                        SchedulerNG newScheduler,
                        JobManagerJobMetricGroup newJobManagerJobMetricGroup) {
                validateRunsInMainThread();
                checkState(schedulerNG.requestJobStatus().isTerminalState());
                checkState(jobManagerJobMetricGroup == null);
 
-               schedulerNG = newScheduler;
-               jobManagerJobMetricGroup = newJobManagerJobMetricGroup;
+               assignScheduler(newScheduler, newJobManagerJobMetricGroup);
+       }
+
+       private void assignScheduler(
+                       SchedulerNG scheduler,
+                       JobManagerJobMetricGroup jobManagerJobMetricGroup) {
+
+               this.schedulerNG = scheduler;
+               this.jobManagerJobMetricGroup = jobManagerJobMetricGroup;
+
+               log.info("Scheduler {} is used for job {}.", schedulerNG, 
jobGraph.getJobID());
 
 Review comment:
   You are right that in the absence of an explicit configuration entry/system 
variable, one has to check the config option's default value. However, there 
are still reasons against logging in the JobMaster constructor:
   * Potentially logged multiple times in sesssion clusters.
   * It is not expected that the end-user has to change the scheduler. 
Hopefully `legacy` will be removed soon and there are no concrete plans to 
include additional schedulers in the repository at the moment.
   * No proper `toString()` implementation at the moment (classname@hexcode 
does not look nice).
   * Side effects in constructor should be avoided.
   
   Since the rest of the PR looks good, I will drop the commit for now.

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