smengcl commented on code in PR #4438:
URL: https://github.com/apache/ozone/pull/4438#discussion_r1146830424


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -797,14 +831,14 @@ private int addToReport(String jobId, int index,
   private synchronized void updateJobStatus(String jobKey,
                                             JobStatus oldStatus,
                                             JobStatus newStatus) {
-    SnapshotDiffJob report = snapDiffJobTable.get(jobKey);
-    if (report.getStatus() != oldStatus) {
+    SnapshotDiffJob snapshotDiffJob = snapDiffJobTable.get(jobKey);
+    if (snapshotDiffJob.getStatus() != oldStatus) {
       throw new IllegalStateException("Invalid job status. Current job " +
-          "status is '" + report.getStatus() + "', while '" + oldStatus +
-          "' is expected.");
+          "status is '" + snapshotDiffJob.getStatus() + "', while '" +
+          oldStatus + "' is expected.");
     }
-    snapDiffJobTable.put(jobKey,
-        new SnapshotDiffJob(report.getJobId(), newStatus));
+    snapshotDiffJob.setStatus(newStatus);
+    snapDiffJobTable.put(jobKey, snapshotDiffJob);
   }

Review Comment:
   Now that we decided to intentionally prevent SnapDiff job status from going 
through Ratis. Let's keep the SnapDiff job status in the separate DB and not in 
the main OM DB.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to