SOLR-10985: Remove unnecessary toString() calls in solr-core's search package's debug logging.

(Michael Braun via Christine Poerschke)
This commit is contained in:
Christine Poerschke 2017-07-07 16:22:39 +01:00
parent 5d1f57f882
commit b123ebad48
4 changed files with 15 additions and 13 deletions

View File

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

View File

@ -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) {

View File

@ -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();

View File

@ -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);
}
}