asalamon74 commented on a change in pull request #326: URL: https://github.com/apache/solr/pull/326#discussion_r722220992
########## File path: solr/core/src/java/org/apache/solr/core/SolrCore.java ########## @@ -491,22 +490,27 @@ public long getIndexSize() { } public long getCachedIndexSize() { - if (indexSize.get() == null) { - if (log.isDebugEnabled()) { - log.debug("Recalculating index size for {}", getName()); + SolrRequestInfo requestInfo = SolrRequestInfo.getRequestInfo(); + if (requestInfo != null) { + Map<Object,Object> contextMap = requestInfo.getReq().getContext(); + Long cachedIndexSize = (Long)contextMap.get(cachedIndexSizeKeyName(getName())); Review comment: I'll change it. ########## File path: solr/core/src/java/org/apache/solr/core/SolrCore.java ########## @@ -491,22 +490,27 @@ public long getIndexSize() { } public long getCachedIndexSize() { - if (indexSize.get() == null) { - if (log.isDebugEnabled()) { - log.debug("Recalculating index size for {}", getName()); + SolrRequestInfo requestInfo = SolrRequestInfo.getRequestInfo(); + if (requestInfo != null) { + Map<Object,Object> contextMap = requestInfo.getReq().getContext(); + Long cachedIndexSize = (Long)contextMap.get(cachedIndexSizeKeyName(getName())); Review comment: Those logs were very useful for me, when I did the testing but true, in the final version the simplified code is more important, so I'll change it. -- 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-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org