mirror of https://github.com/apache/lucene.git
SOLR-9374: Speed up Jmx MBean retrieval for FieldCache
This commit is contained in:
parent
4f316bc199
commit
b1b933eb43
|
@ -92,6 +92,8 @@ Bug Fixes
|
|||
Optimizations
|
||||
----------------------
|
||||
|
||||
* SOLR-9374: Speed up Jmx MBean retrieval for FieldCache. (Tim Owen via shalin)
|
||||
|
||||
Other Changes
|
||||
----------------------
|
||||
|
||||
|
|
|
@ -61,12 +61,14 @@ public class SolrFieldCacheMBean implements JmxAugmentedSolrInfoMBean {
|
|||
|
||||
private NamedList getStats(boolean listEntries) {
|
||||
NamedList stats = new SimpleOrderedMap();
|
||||
String[] entries = UninvertingReader.getUninvertedStats();
|
||||
stats.add("entries_count", entries.length);
|
||||
if (listEntries) {
|
||||
String[] entries = UninvertingReader.getUninvertedStats();
|
||||
stats.add("entries_count", entries.length);
|
||||
for (int i = 0; i < entries.length; i++) {
|
||||
stats.add("entry#" + i, entries[i]);
|
||||
}
|
||||
} else {
|
||||
stats.add("entries_count", UninvertingReader.getUninvertedStatsSize());
|
||||
}
|
||||
return stats;
|
||||
}
|
||||
|
|
|
@ -388,4 +388,8 @@ public class UninvertingReader extends FilterLeafReader {
|
|||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public static int getUninvertedStatsSize() {
|
||||
return FieldCache.DEFAULT.getCacheEntries().length;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue