enrichment of PerformanceMemory display of SolrInfoMBean table

pull/1/head
Michael Peter Christen 11 years ago
parent e8bdf16ea7
commit 9228214f9b

@ -93,7 +93,7 @@
</tr>
#{/SolrList}#
<tr class="TableCellDark">
<td colspan="5">Total Cache Count = #[SolrCacheCount]#</td>
<td colspan="6">Total Cache Count = #[SolrCacheCount]#</td>
</tr>
</table>

@ -26,10 +26,10 @@
//import java.util.Iterator;
import java.io.File;
import java.util.Collection;
import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import org.apache.solr.core.SolrInfoMBean;
import org.apache.solr.search.SolrCache;
@ -110,16 +110,19 @@ public class PerformanceMemory_p {
prop.putNum("memoryUsedNow", MemoryControl.used() / MB);
Collection<SolrInfoMBean> solrCaches = sb.index.fulltext().getSolrInfoBeans();
final Map<String, SolrInfoMBean> solrInfoMBeans = sb.index.fulltext().getSolrInfoBeans();
final TreeMap<String, Map.Entry<String, SolrInfoMBean>> solrBeanOM = new TreeMap<String, Map.Entry<String, SolrInfoMBean>>();
int c = 0;
for (Map.Entry<String, SolrInfoMBean> sc: solrInfoMBeans.entrySet()) solrBeanOM.put(sc.getValue().getName() + "$" + sc.getKey() + "$" + c++, sc);
c = 0;
int scc = 0;
for (SolrInfoMBean sc: solrCaches) {
prop.put("SolrList_" + c + "_class", sc.getName());
prop.put("SolrList_" + c + "_type", sc instanceof SolrCache ? ((SolrCache<?,?>)sc).name() : "");
prop.put("SolrList_" + c + "_description", sc.getDescription());
prop.put("SolrList_" + c + "_statistics", sc.getStatistics() == null ? "" : sc.getStatistics().toString().replaceAll(",", ", "));
prop.put("SolrList_" + c + "_size", sc instanceof SolrCache ? Integer.toString(((SolrCache<?,?>)sc).size()) : "");
if (sc instanceof SolrCache) scc++;
for (Map.Entry<String, SolrInfoMBean> sc: solrBeanOM.values()) {
prop.put("SolrList_" + c + "_class", sc.getValue().getName());
prop.put("SolrList_" + c + "_type", sc.getKey());
prop.put("SolrList_" + c + "_description", sc.getValue().getDescription());
prop.put("SolrList_" + c + "_statistics", sc.getValue().getStatistics() == null ? "" : sc.getValue().getStatistics().toString().replaceAll(",", ", "));
prop.put("SolrList_" + c + "_size", sc.getValue() instanceof SolrCache ? Integer.toString(((SolrCache<?,?>)sc.getValue()).size()) : "");
if (sc.getValue() instanceof SolrCache) scc++;
c++;
}
prop.put("SolrList", c);

@ -23,8 +23,8 @@ package net.yacy.cora.federate.solr.connector;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.BlockingQueue;
@ -110,8 +110,8 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCo
return 0;
}
public Collection<SolrInfoMBean> getSolrInfoBeans() {
return this.core.getInfoRegistry().values();
public Map<String, SolrInfoMBean> getSolrInfoBeans() {
return this.core.getInfoRegistry();
}
@Override

@ -31,6 +31,7 @@ import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@ -196,9 +197,9 @@ public final class Fulltext {
}
}
public Collection<SolrInfoMBean> getSolrInfoBeans() {
public Map<String, SolrInfoMBean> getSolrInfoBeans() {
EmbeddedSolrConnector esc = this.solrInstances.getDefaultEmbeddedConnector();
if (esc == null) return new ArrayList<SolrInfoMBean>(0);
if (esc == null) return new HashMap<String, SolrInfoMBean>();
return esc.getSolrInfoBeans();
}

Loading…
Cancel
Save