You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "jojochuang (via GitHub)" <gi...@apache.org> on 2023/01/26 18:49:22 UTC
[GitHub] [hbase] jojochuang commented on a diff in pull request #4995: HBASE-27590 Change Iterable to List in CleanerChore
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: issues-unsubscribe@hbase.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org