SaketaChalamchala commented on code in PR #11296:
URL: https://github.com/apache/ozone/pull/11296#discussion_r4251425856


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/diff/SnapDiffJobStore.java:
##########
@@ -262,37 +499,132 @@ public void flushWrites() throws IOException {
     pendingOps = 0;
   }
 
+  /**
+   * Starts batched emission of resolved rows to the snap diff report table.
+   */
+  public void beginReportWrite() {
+    if (reportWriteStarted) {
+      throw new IllegalStateException("Snap diff report write already started 
for job " + jobId);
+    }
+    reportWriteStarted = true;
+    reportIndex = 0;
+    largestReportKey = "";
+  }
+
+  /**
+   * Appends one resolved {@link DiffReportEntry} to the snap diff report 
table.
+   */
+  public void putReportEntry(DiffReportEntry entry) throws IOException {
+    if (!reportWriteStarted) {
+      throw new IllegalStateException("Snap diff report write not started for 
job " + jobId);
+    }
+    appendReportEntry(entry);
+  }
+
+  /**
+   * Appends a batch of resolved {@link DiffReportEntry}s to the snap diff 
report table.
+   */
+  public void putReportEntries(List<DiffReportEntry> entries) throws 
IOException {
+    if (!reportWriteStarted) {
+      throw new IllegalStateException("Snap diff report write not started for 
job " + jobId);
+    }
+    for (DiffReportEntry entry : entries) {
+      appendReportEntry(entry);
+    }
+  }
+
+  /**
+   * Appends a batch of resolved and ordered {@link DiffReportEntry}s to the 
snap diff report table.
+   */
+  public void putOrderedReportEntries(List<DiffReportEntry> entries) throws 
IOException {
+    if (!reportWriteStarted) {
+      throw new IllegalStateException("Snap diff report write not started for 
job " + jobId);
+    }
+    for (DiffReportEntry entry : entries) {
+      String jobReportKey = getReportKeyForIndex(jobId, 
leftPad(String.valueOf(reportIndex++), 21, '0'));

Review Comment:
   Fixed the validation and the later parsing of index to accommodate ordered 
reports.



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