Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
enrichment of PerformanceMemory display of SolrInfoMBean table
Michael Peter Christen9228214f9b50
diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.htmlindex 200aee8f2..0a02697d3 100644--- a/htroot/PerformanceMemory_p.html+++ b/htroot/PerformanceMemory_p.html@@ -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>diff --git a/htroot/PerformanceMemory_p.java b/htroot/PerformanceMemory_p.javaindex 57bdc0c51..75dbc377e 100644--- a/htroot/PerformanceMemory_p.java+++ b/htroot/PerformanceMemory_p.java@@ -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);diff --git a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.javaindex 7a5c20481..ab8897cbe 100644--- a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java+++ b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java@@ -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 SolrCoreturn 0;}- public Collection<SolrInfoMBean> getSolrInfoBeans() {- return this.core.getInfoRegistry().values();+ public Map<String, SolrInfoMBean> getSolrInfoBeans() {+ return this.core.getInfoRegistry();}@Overridediff --git a/source/net/yacy/search/index/Fulltext.java b/source/net/yacy/search/index/Fulltext.javaindex b9ebb4688..753311d13 100644--- a/source/net/yacy/search/index/Fulltext.java+++ b/source/net/yacy/search/index/Fulltext.java@@ -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();}