Repository: hive Updated Branches: refs/heads/master 4c74a7396 -> f8f3f415e
HIVE-20223: SmallTableCache.java SLF4J Parameterized Logging (BELUGA BEHR, reviewed by Prasanth Jayachandran and Peter Vary) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/f8f3f415 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/f8f3f415 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/f8f3f415 Branch: refs/heads/master Commit: f8f3f415e832e267ba94e9a10afd0e869afd6c7c Parents: 4c74a73 Author: BELUGA BEHR <[email protected]> Authored: Thu Nov 29 12:13:04 2018 +0100 Committer: Peter Vary <[email protected]> Committed: Thu Nov 29 12:13:04 2018 +0100 ---------------------------------------------------------------------- .../hadoop/hive/ql/exec/spark/SmallTableCache.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/f8f3f415/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SmallTableCache.java ---------------------------------------------------------------------- diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SmallTableCache.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SmallTableCache.java index 3293100..b2ce71b 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SmallTableCache.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/SmallTableCache.java @@ -27,7 +27,7 @@ import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.ql.exec.persistence.MapJoinTableContainer; public class SmallTableCache { - private static final Logger LOG = LoggerFactory.getLogger(SmallTableCache.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(SmallTableCache.class); private static final ConcurrentHashMap<Path, MapJoinTableContainer> tableContainerMap = new ConcurrentHashMap<Path, MapJoinTableContainer>(); @@ -47,9 +47,7 @@ public class SmallTableCache { tableContainer.clear(); } tableContainerMap.clear(); - if (LOG.isDebugEnabled()) { - LOG.debug("Cleaned up small table cache for query " + queryId); - } + LOG.debug("Cleaned up small table cache for query {}", queryId); } } } @@ -58,16 +56,14 @@ public class SmallTableCache { } public static void cache(Path path, MapJoinTableContainer tableContainer) { - if (tableContainerMap.putIfAbsent(path, tableContainer) == null && LOG.isDebugEnabled()) { - LOG.debug("Cached small table file " + path + " for query " + queryId); + if (tableContainerMap.putIfAbsent(path, tableContainer) == null) { + LOG.debug("Cached small table file {} for query {}", path, queryId); } } public static MapJoinTableContainer get(Path path) { MapJoinTableContainer tableContainer = tableContainerMap.get(path); - if (tableContainer != null && LOG.isDebugEnabled()) { - LOG.debug("Loaded small table file " + path + " from cache for query " + queryId); - } + LOG.debug("Loaded small table file {} from cache for query {}", path, queryId); return tableContainer; } }
