You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/01/28 10:08:04 UTC
[GitHub] azagrebin commented on a change in pull request #7564:
[FLINK-11415] Introduce JobMasterServiceFactory
azagrebin commented on a change in pull request #7564: [FLINK-11415] Introduce JobMasterServiceFactory
URL: https://github.com/apache/flink/pull/7564#discussion_r251345072
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerRunner.java
##########
@@ -140,29 +132,10 @@ public JobManagerRunner(
this.runningJobsRegistry = haServices.getRunningJobsRegistry();
this.leaderElectionService = haServices.getJobManagerLeaderElectionService(jobGraph.getJobID());
- final JobMasterConfiguration jobMasterConfiguration = JobMasterConfiguration.fromConfiguration(configuration);
-
this.leaderGatewayFuture = new CompletableFuture<>();
- final SlotPoolFactory slotPoolFactory = DefaultSlotPoolFactory.fromConfiguration(
- configuration,
- rpcService);
-
// now start the JobManager
- this.jobMasterService = new JobMaster(
- rpcService,
- jobMasterConfiguration,
- resourceId,
- jobGraph,
- haServices,
- slotPoolFactory,
- jobManagerSharedServices,
- heartbeatServices,
- blobServer,
- jobManagerJobMetricGroupFactory,
- this,
- fatalErrorHandler,
- userCodeLoader);
+ this.jobMasterService = jobMasterFactory.createJobMasterService(jobGraph, this, userCodeLoader);
Review comment:
I am wondering whether we could inject already constructed `jobMasterService` at this point.
The code associated with the `user code` could be part of factory (`libraryCacheManager.registerJob(...` and `userCodeLoader = ...`) making `JobManagerRunner` constructor exception-free and having only dependence assignments.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services