HDFS-12808. Add LOG.isDebugEnabled() guard for LOG.debug(...). Contributed by Bharat Viswanadham.

This commit is contained in:
Inigo Goiri 2018-01-08 17:51:09 -08:00
parent 59ab5da0a0
commit b3290c41a9
1 changed files with 5 additions and 5 deletions

View File

@ -23,8 +23,8 @@
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import org.apache.commons.logging.Log; import org.slf4j.Logger;
import org.apache.commons.logging.LogFactory; import org.slf4j.LoggerFactory;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream; import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FSDataOutputStream; import org.apache.hadoop.fs.FSDataOutputStream;
@ -48,7 +48,8 @@
import org.junit.Test; import org.junit.Test;
public class TestCachingStrategy { public class TestCachingStrategy {
private static final Log LOG = LogFactory.getLog(TestCachingStrategy.class); private static final Logger LOG =
LoggerFactory.getLogger(TestCachingStrategy.class);
private static final int MAX_TEST_FILE_LEN = 1024 * 1024; private static final int MAX_TEST_FILE_LEN = 1024 * 1024;
private static final int WRITE_PACKET_SIZE = HdfsClientConfigKeys.DFS_CLIENT_WRITE_PACKET_SIZE_DEFAULT; private static final int WRITE_PACKET_SIZE = HdfsClientConfigKeys.DFS_CLIENT_WRITE_PACKET_SIZE_DEFAULT;
@ -80,8 +81,7 @@ private static class Stats {
} }
synchronized void fadvise(int offset, int len, int flags) { synchronized void fadvise(int offset, int len, int flags) {
LOG.debug("got fadvise(offset=" + offset + ", len=" + len + LOG.debug("got fadvise(offset={}, len={}, flags={})", offset, len, flags);
",flags=" + flags + ")");
if (flags == POSIX_FADV_DONTNEED) { if (flags == POSIX_FADV_DONTNEED) {
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
dropped[(offset + i)] = true; dropped[(offset + i)] = true;