rmatharu commented on a change in pull request #1137: SAMZA-2301: Improve 
zookeeper metadata-store implementation
URL: https://github.com/apache/samza/pull/1137#discussion_r313986650
 
 

 ##########
 File path: samza-core/src/main/java/org/apache/samza/zk/ZkJobCoordinator.java
 ##########
 @@ -403,12 +405,14 @@ private GrouperMetadataImpl getGrouperMetadata(String 
jobModelVersion, List<Proc
     Map<TaskName, List<SystemStreamPartition>> taskToSSPs = new HashMap<>();
     if (jobModelVersion != null) {
       JobModel jobModel = readJobModelFromMetadataStore(jobModelVersion);
-      for (ContainerModel containerModel : jobModel.getContainers().values()) {
-        for (TaskModel taskModel : containerModel.getTasks().values()) {
-          taskToProcessorId.put(taskModel.getTaskName(), 
containerModel.getId());
-          for (SystemStreamPartition partition : 
taskModel.getSystemStreamPartitions()) {
-            taskToSSPs.computeIfAbsent(taskModel.getTaskName(), k -> new 
ArrayList<>());
-            taskToSSPs.get(taskModel.getTaskName()).add(partition);
+      if (jobModel != null) {
+        for (ContainerModel containerModel : 
jobModel.getContainers().values()) {
+          for (TaskModel taskModel : containerModel.getTasks().values()) {
+            taskToProcessorId.put(taskModel.getTaskName(), 
containerModel.getId());
+            for (SystemStreamPartition partition : 
taskModel.getSystemStreamPartitions()) {
+              taskToSSPs.computeIfAbsent(taskModel.getTaskName(), k -> new 
ArrayList<>());
 
 Review comment:
   Could this be 
   `taskToSSPs.putIfAbsent(taskModel.getTaskName(), new ArrayList<>());` ?

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