jojochuang commented on code in PR #9810:
URL: https://github.com/apache/ozone/pull/9810#discussion_r2843566405


##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/SnapshotChainManager.java:
##########
@@ -378,7 +393,9 @@ public synchronized boolean deleteSnapshot(SnapshotInfo 
snapshotInfo)
    */
   public synchronized void removeFromSnapshotIdToTable(UUID snapshotId) throws 
IOException {
     validateSnapshotChain();
-    snapshotIdToTableKey.remove(snapshotId);
+    String tableKey = snapshotIdToTableKey.remove(snapshotId);
+    LOG.debug("Removed from snapshotIdToTableKey: snapshotId={} tableKey={}. 
caller: {}",
+        snapshotId, tableKey, Thread.currentThread().getStackTrace()[2]);

Review Comment:
   it looks like the `Thread.currentThread().getStackTrace()[2]` could still be 
evaluated even if the log object is not in debug level. Better to wrap it 
around an if-else.
   ```suggestion
       if (LOG.isDebugEnabled()) {
         LOG.debug("Removed from snapshotIdToTableKey: snapshotId={} 
tableKey={}. caller: {}",
             snapshotId, tableKey, Thread.currentThread().getStackTrace()[2]);
       }
   ```



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