jojochuang commented on code in PR #4995:
URL: https://github.com/apache/hbase/pull/4995#discussion_r1088183772


##########
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationHFileCleaner.java:
##########
@@ -65,26 +64,23 @@ public Iterable<FileStatus> 
getDeletableFiles(Iterable<FileStatus> files) {
       LOG.warn("Failed to read hfile references from zookeeper, skipping 
checking deletable files");
       return Collections.emptyList();
     }
-    return Iterables.filter(files, new Predicate<FileStatus>() {
-      @Override
-      public boolean apply(FileStatus file) {
-        // just for overriding the findbugs NP warnings, as the parameter is 
marked as Nullable in
-        // the guava Predicate.
-        if (file == null) {
-          return false;
-        }
-        String hfile = file.getPath().getName();
-        boolean foundHFileRefInQueue = hfileRefs.contains(hfile);
-        if (LOG.isDebugEnabled()) {
-          if (foundHFileRefInQueue) {
-            LOG.debug("Found hfile reference in ZK, keeping: " + hfile);
-          } else {
-            LOG.debug("Did not find hfile reference in ZK, deleting: " + 
hfile);
-          }
+    return files.stream().filter(file -> {
+      // just for overriding the findbugs NP warnings, as the parameter is 
marked as Nullable in
+      // the guava Predicate.
+      if (file == null) {
+        return false;
+      }
+      String hfile = file.getPath().getName();
+      boolean foundHFileRefInQueue = hfileRefs.contains(hfile);
+      if (LOG.isDebugEnabled()) {
+        if (foundHFileRefInQueue) {
+          LOG.debug("Found hfile reference in ZK, keeping: " + hfile);

Review Comment:
   Use parameterized logging to avoid string concatenation cost. And then you 
can remove the LOG.isDebugEnabled() check.



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

Reply via email to