diff options
| author | Michael Peter Christen <mc@yacy.net> | 2014-02-07 00:22:31 +0100 |
|---|---|---|
| committer | Michael Peter Christen <mc@yacy.net> | 2014-02-07 00:22:31 +0100 |
| commit | 9228214f9b50287322a90210ce70602eeae01159 (patch) | |
| tree | 3f3937590653e83df39f2c7248f4cddbdc543f21 | |
| parent | e8bdf16ea7550ee9db20ac1be9d6cfa0571d6485 (diff) | |
enrichment of PerformanceMemory display of SolrInfoMBean table
| -rw-r--r-- | htroot/PerformanceMemory_p.html | 2 | ||||
| -rw-r--r-- | htroot/PerformanceMemory_p.java | 21 | ||||
| -rw-r--r-- | source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java | 6 | ||||
| -rw-r--r-- | source/net/yacy/search/index/Fulltext.java | 5 |
4 files changed, 19 insertions, 15 deletions
diff --git a/htroot/PerformanceMemory_p.html b/htroot/PerformanceMemory_p.html index 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.java index 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.java index 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 SolrCo return 0; } - public Collection<SolrInfoMBean> getSolrInfoBeans() { - return this.core.getInfoRegistry().values(); + public Map<String, SolrInfoMBean> getSolrInfoBeans() { + return this.core.getInfoRegistry(); } @Override diff --git a/source/net/yacy/search/index/Fulltext.java b/source/net/yacy/search/index/Fulltext.java index 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(); } |
