lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r826788 - /lucene/solr/trunk/src/java/org/apache/solr/search/SolrFieldCacheMBean.java
Date Mon, 19 Oct 2009 19:44:42 GMT
Author: hossman
Date: Mon Oct 19 19:44:41 2009
New Revision: 826788

URL: http://svn.apache.org/viewvc?rev=826788&view=rev
Log:
SOLR-1292: followup tweak based on mailing list discussion: for indexes with lots of segments,
estimating the size of all the field caches can take a lot of time (particularly with lots
of String based caches) so for now we only estimate the size for items which are part of instanity
instances

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/search/SolrFieldCacheMBean.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/SolrFieldCacheMBean.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/SolrFieldCacheMBean.java?rev=826788&r1=826787&r2=826788&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/SolrFieldCacheMBean.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/SolrFieldCacheMBean.java Mon Oct 19
19:44:41 2009
@@ -61,7 +61,6 @@
     stats.add("entries_count", entries.length);
     for (int i = 0; i < entries.length; i++) {
       CacheEntry e = entries[i];
-      e.estimateSize();
       stats.add("entry#" + i, e.toString());
     }
 
@@ -69,6 +68,13 @@
 
     stats.add("insanity_count", insanity.length);
     for (int i = 0; i < insanity.length; i++) {
+
+      // we only estimate the size of insane entries
+      for (CacheEntry e : insanity[i].getCacheEntries()) {
+        // don't re-estimate if we've already done it.
+        if (null == e.getEstimatedSize()) e.estimateSize();
+      }
+      
       stats.add("insanity#" + i, insanity[i].toString());
     }
     return stats;



Mime
View raw message