kw2542 commented on a change in pull request #1248: SAMZA-2410: Update 
ClusterBasedJobCoordinator config retrieval logic from loader.
URL: https://github.com/apache/samza/pull/1248#discussion_r365487071
 
 

 ##########
 File path: 
samza-core/src/main/java/org/apache/samza/clustermanager/ClusterBasedJobCoordinator.java
 ##########
 @@ -178,9 +185,35 @@
   public ClusterBasedJobCoordinator(Config coordinatorSystemConfig) {
     metrics = new MetricsRegistryMap();
 
-    coordinatorStreamStore = new 
CoordinatorStreamStore(coordinatorSystemConfig, metrics);
-    coordinatorStreamStore.init();
-    config = 
CoordinatorStreamUtil.readConfigFromCoordinatorStream(coordinatorStreamStore);
+    JobConfig jobConfig = new JobConfig(coordinatorSystemConfig);
+
+    if (jobConfig.getConfigLoaderFactory().isPresent()) {
+      // load full job config with ConfigLoader
+      Config originalConfig = ConfigUtil.loadConfig(coordinatorSystemConfig);
+
+      // Execute planning
+      ApplicationDescriptorImpl<? extends ApplicationDescriptor>
+          appDesc = 
ApplicationDescriptorUtil.getAppDescriptor(ApplicationUtil.fromConfig(originalConfig),
 originalConfig);
+      RemoteJobPlanner planner = new RemoteJobPlanner(appDesc);
+      List<JobConfig> jobConfigs = planner.prepareJobs();
+
+      if (jobConfigs.size() != 1) {
+        throw new SamzaException("Only support single remote job is 
supported.");
+      }
+
+      // Merge with default coordinator stream config
+      config = ConfigUtil.override(jobConfigs.get(0), 
CoordinatorStreamUtil.buildCoordinatorStreamConfig(jobConfigs.get(0)));
 
 Review comment:
   Good question, you are right, we should not need to merge it with the full 
job config, we only need to build it from the full job config and initialize 
CoordinatorStreamStore.

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