lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cpoersc...@apache.org
Subject [2/2] lucene-solr:master: SOLR-10985: Remove unnecessary toString() calls in solr-core's search package's debug logging. (Michael Braun via Christine Poerschke)
Date Fri, 07 Jul 2017 16:38:07 GMT
SOLR-10985: Remove unnecessary toString() calls in solr-core's search package's debug logging.
(Michael Braun via Christine Poerschke)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/b123ebad
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/b123ebad
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/b123ebad

Branch: refs/heads/master
Commit: b123ebad4814132182ad15651e1aabe6e53e7558
Parents: 5d1f57f
Author: Christine Poerschke <cpoerschke@apache.org>
Authored: Fri Jul 7 16:22:39 2017 +0100
Committer: Christine Poerschke <cpoerschke@apache.org>
Committed: Fri Jul 7 17:37:19 2017 +0100

----------------------------------------------------------------------
 solr/CHANGES.txt                                  |  3 ++-
 .../apache/solr/search/stats/ExactStatsCache.java |  5 ++---
 .../apache/solr/search/stats/LRUStatsCache.java   |  2 +-
 .../apache/solr/search/stats/LocalStatsCache.java | 18 ++++++++++--------
 4 files changed, 15 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b123ebad/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 60c3b98..022a28e 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -67,7 +67,8 @@ Bug Fixes
 Optimizations
 ----------------------
 
-(No Changes)
+* SOLR-10985: Remove unnecessary toString() calls in solr-core's search package's debug logging.
+  (Michael Braun via Christine Poerschke)
 
 Other Changes
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b123ebad/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java b/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java
index 413584d..b4e76d4 100644
--- a/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java
+++ b/solr/core/src/java/org/apache/solr/search/stats/ExactStatsCache.java
@@ -179,15 +179,14 @@ public class ExactStatsCache extends StatsCache {
         String termStatsString = StatsUtil.termStatsMapToString(statsMap);
         rb.rsp.add(TERM_STATS_KEY, termStatsString);
         if (LOG.isDebugEnabled()) {
-          LOG.debug("termStats=" + termStatsString + ", terms=" + terms + ", numDocs=" +
searcher.maxDoc());
+          LOG.debug("termStats={}, terms={}, numDocs={}", termStatsString, terms, searcher.maxDoc());
         }
       }
       if (colMap.size() != 0){
         String colStatsString = StatsUtil.colStatsMapToString(colMap);
         rb.rsp.add(COL_STATS_KEY, colStatsString);
         if (LOG.isDebugEnabled()) {
-          LOG.debug("collectionStats="
-              + colStatsString + ", terms=" + terms + ", numDocs=" + searcher.maxDoc());
+          LOG.debug("collectionStats={}, terms={}, numDocs={}", colStatsString, terms, searcher.maxDoc());
         }
       }
     } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b123ebad/solr/core/src/java/org/apache/solr/search/stats/LRUStatsCache.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/stats/LRUStatsCache.java b/solr/core/src/java/org/apache/solr/search/stats/LRUStatsCache.java
index ffcc99d..99efb8d 100644
--- a/solr/core/src/java/org/apache/solr/search/stats/LRUStatsCache.java
+++ b/solr/core/src/java/org/apache/solr/search/stats/LRUStatsCache.java
@@ -136,7 +136,7 @@ public class LRUStatsCache extends ExactStatsCache {
         throws IOException {
       TermStats termStats = termStatsCache.get(term.toString());
       if (termStats == null) {
-        LOG.debug("## Missing global termStats info: {}, using local", term.toString());
+        LOG.debug("## Missing global termStats info: {}, using local", term);
         return localSearcher.localTermStatistics(term, context);
       } else {
         return termStats.toTermStatistics();

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b123ebad/solr/core/src/java/org/apache/solr/search/stats/LocalStatsCache.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/search/stats/LocalStatsCache.java b/solr/core/src/java/org/apache/solr/search/stats/LocalStatsCache.java
index 2eb3fc0..90395f5 100644
--- a/solr/core/src/java/org/apache/solr/search/stats/LocalStatsCache.java
+++ b/solr/core/src/java/org/apache/solr/search/stats/LocalStatsCache.java
@@ -38,7 +38,7 @@ public class LocalStatsCache extends StatsCache {
 
   @Override
   public StatsSource get(SolrQueryRequest req) {
-    LOG.debug("## GET {}", req.toString());
+    LOG.debug("## GET {}", req);
     return new LocalStatsSource();
   }
 
@@ -49,31 +49,33 @@ public class LocalStatsCache extends StatsCache {
   // by returning null we don't create additional round-trip request.
   @Override
   public ShardRequest retrieveStatsRequest(ResponseBuilder rb) {
-    LOG.debug("## RDR {}", rb.req.toString());
+    LOG.debug("## RDR {}", rb.req);
     return null;
   }
 
   @Override
   public void mergeToGlobalStats(SolrQueryRequest req,
           List<ShardResponse> responses) {
-    LOG.debug("## MTGD {}", req.toString());
-    for (ShardResponse r : responses) {
-      LOG.debug(" - {}", r);
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("## MTGD {}", req);
+      for (ShardResponse r : responses) {
+        LOG.debug(" - {}", r);
+      }
     }
   }
 
   @Override
   public void returnLocalStats(ResponseBuilder rb, SolrIndexSearcher searcher) {
-    LOG.debug("## RLD {}", rb.req.toString());
+    LOG.debug("## RLD {}", rb.req);
   }
 
   @Override
   public void receiveGlobalStats(SolrQueryRequest req) {
-    LOG.debug("## RGD {}", req.toString());
+    LOG.debug("## RGD {}", req);
   }
 
   @Override
   public void sendGlobalStats(ResponseBuilder rb, ShardRequest outgoing) {
-    LOG.debug("## SGD {}", outgoing.toString());
+    LOG.debug("## SGD {}", outgoing);
   }
 }


Mime
View raw message