You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2021/06/28 06:18:31 UTC

[GitHub] [ozone] jojochuang commented on a change in pull request #2372: HDDS-5383. Eliminate expensive string creation in debug log messages

jojochuang commented on a change in pull request #2372:
URL: https://github.com/apache/ozone/pull/2372#discussion_r659505828



##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -201,9 +201,9 @@ public void run() {
           if (now >= end) {
             Collection<FileStatus> trashRoots;
             trashRoots = fs.getTrashRoots(true); // list all trash dirs
-            LOG.debug("Trash root Size: " + trashRoots.size());
+            LOG.debug("Trash root Size: {}" + trashRoots.size());
             for (FileStatus trashRoot : trashRoots) {  // dump each trash
-              LOG.debug("Trashroot:" + trashRoot.getPath().toString());
+              LOG.debug("Trashroot: {}" + trashRoot.getPath());

Review comment:
       here too

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -126,9 +126,9 @@ public boolean moveToTrash(Path path) throws IOException {
     Path trashRoot = this.fs.getTrashRoot(path);
 
     String key = path.toUri().getPath();
-    LOG.debug("Key path to moveToTrash: "+ key);
+    LOG.debug("Key path to moveToTrash: {}"+ key);

Review comment:
       this'll still result in an string concantenation.
   So change it to:
   `LOG.debug("Key path to moveToTrash: {}",key);`

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -266,7 +266,8 @@ private void createCheckpoint(Path trashRoot, Date date) throws IOException {
     while (true) {
       try {
         fs.rename(current, checkpoint);
-        LOG.debug("Created trash checkpoint: " + checkpoint.toUri().getPath());
+        LOG.debug("Created trash checkpoint: {}"
+                + checkpoint.toUri().getPath());

Review comment:
       here too.

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -201,9 +201,9 @@ public void run() {
           if (now >= end) {
             Collection<FileStatus> trashRoots;
             trashRoots = fs.getTrashRoots(true); // list all trash dirs
-            LOG.debug("Trash root Size: " + trashRoots.size());
+            LOG.debug("Trash root Size: {}" + trashRoots.size());

Review comment:
       same here. replace + with ,

##########
File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/TrashPolicyOzone.java
##########
@@ -126,9 +126,9 @@ public boolean moveToTrash(Path path) throws IOException {
     Path trashRoot = this.fs.getTrashRoot(path);
 
     String key = path.toUri().getPath();
-    LOG.debug("Key path to moveToTrash: "+ key);
+    LOG.debug("Key path to moveToTrash: {}"+ key);
     String trashRootKey = trashRoot.toUri().getPath();
-    LOG.debug("TrashrootKey for moveToTrash: "+ trashRootKey);
+    LOG.debug("TrashrootKey for moveToTrash: {}"+ trashRootKey);

Review comment:
       ditto

##########
File path: hadoop-hdds/client/src/main/java/org/apache/hadoop/hdds/scm/storage/BlockOutputStream.java
##########
@@ -595,7 +595,7 @@ private void setIoException(Exception e) {
       IOException exception =  new IOException(EXCEPTION_MSG + e.toString(), e);
       ioException.compareAndSet(null, exception);
     } else {
-      LOG.debug("Previous request had already failed with " + ioe.toString()
+      LOG.debug("Previous request had already failed with " + ioe

Review comment:
       please use parameterized logging.
   For example, LOG.debug("Previous request had already failed with {}", ioe)




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