You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "smengcl (via GitHub)" <gi...@apache.org> on 2023/06/20 23:08:33 UTC

[GitHub] [ozone] smengcl commented on a diff in pull request #4722: HDDS-8497. Add leading zeroes on to report table to optimize get Pagecall of Snapdiff

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


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/snapshot/SnapshotDiffManager.java:
##########
@@ -367,6 +367,17 @@ private Set<String> getSSTFileListForSnapshot(OmSnapshot snapshot,
         .getPath(), tablesToLookUp);
   }
 
+  /**
+   * Gets the report key for a particular index of snapshot diff job.
+   * @param jobId Snapshot diff jobId
+   * @param index
+   * @return report Key of the snapshot diff job
+   */
+
+  static String getReportKeyForIndex(String jobId, long index) {
+    return String.format("%s%s%020d", jobId, DELIMITER, index);

Review Comment:
   My hunch is using a format String might be slower than using `StringUtils.leftPad()` on `index` (or even hand-rolling) because of the overhead of parsing the format String itself.
   
   Not a major concern for now. But we can swap this out later.



-- 
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: issues-unsubscribe@ozone.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org