diff --git a/src/java/org/apache/solr/core/SolrCore.java b/src/java/org/apache/solr/core/SolrCore.java index b72a425f7b3..e606862abd6 100644 --- a/src/java/org/apache/solr/core/SolrCore.java +++ b/src/java/org/apache/solr/core/SolrCore.java @@ -238,6 +238,10 @@ public final class SolrCore implements SolrInfoMBean { } /** + * Returns a Map of name vs SolrInfoMBean objects. The returned map is an instance of + * a ConcurrentHashMap and therefore no synchronization is needed for putting, removing + * or iterating over it. + * * @return the Info Registry map which contains SolrInfoMBean objects keyed by name * @since solr 1.3 */ diff --git a/src/java/org/apache/solr/handler/admin/PluginInfoHandler.java b/src/java/org/apache/solr/handler/admin/PluginInfoHandler.java index 3e68899f975..b40f2b81e46 100644 --- a/src/java/org/apache/solr/handler/admin/PluginInfoHandler.java +++ b/src/java/org/apache/solr/handler/admin/PluginInfoHandler.java @@ -59,36 +59,34 @@ public class PluginInfoHandler extends RequestHandlerBase SimpleOrderedMap category = new SimpleOrderedMap(); list.add( cat.name(), category ); Map reg = core.getInfoRegistry(); - synchronized(reg) { - for (Map.Entry entry : reg.entrySet()) { - SolrInfoMBean m = entry.getValue(); - if (m.getCategory() != cat) continue; - - String na = "Not Declared"; - SimpleOrderedMap info = new SimpleOrderedMap(); - category.add( entry.getKey(), info ); - - info.add( "name", (m.getName() !=null ? m.getName() : na) ); - info.add( "version", (m.getVersion() !=null ? m.getVersion() : na) ); - info.add( "description", (m.getDescription()!=null ? m.getDescription() : na) ); - - info.add( "sourceId", (m.getSourceId() !=null ? m.getSourceId() : na) ); - info.add( "source", (m.getSource() !=null ? m.getSource() : na) ); - - URL[] urls = m.getDocs(); - if ((urls != null) && (urls.length > 0)) { - ArrayList docs = new ArrayList(urls.length); - for( URL u : urls ) { - docs.add( u.toExternalForm() ); - } - info.add( "docs", docs ); - } - - if( stats ) { - info.add( "stats", m.getStatistics() ); + for (Map.Entry entry : reg.entrySet()) { + SolrInfoMBean m = entry.getValue(); + if (m.getCategory() != cat) continue; + + String na = "Not Declared"; + SimpleOrderedMap info = new SimpleOrderedMap(); + category.add( entry.getKey(), info ); + + info.add( "name", (m.getName() !=null ? m.getName() : na) ); + info.add( "version", (m.getVersion() !=null ? m.getVersion() : na) ); + info.add( "description", (m.getDescription()!=null ? m.getDescription() : na) ); + + info.add( "sourceId", (m.getSourceId() !=null ? m.getSourceId() : na) ); + info.add( "source", (m.getSource() !=null ? m.getSource() : na) ); + + URL[] urls = m.getDocs(); + if ((urls != null) && (urls.length > 0)) { + ArrayList docs = new ArrayList(urls.length); + for( URL u : urls ) { + docs.add( u.toExternalForm() ); } + info.add( "docs", docs ); } - } + + if( stats ) { + info.add( "stats", m.getStatistics() ); + } + } } return list; } diff --git a/src/webapp/web/admin/stats.jsp b/src/webapp/web/admin/stats.jsp index 7e0f7b9cd89..9ce23281691 100644 --- a/src/webapp/web/admin/stats.jsp +++ b/src/webapp/web/admin/stats.jsp @@ -40,7 +40,6 @@ for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) { <<%= cat.toString() %>> <% Map reg = core.getInfoRegistry(); - synchronized(reg) { for (Map.Entry entry : reg.entrySet()) { String key = entry.getKey(); SolrInfoMBean m = entry.getValue(); @@ -84,7 +83,6 @@ for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) { %> <% } - } %> > <%