mirror of https://github.com/apache/lucene.git
SOLR-3330: add option to include the original 'ref' nodes
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1327775 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
cd016ccf42
commit
86408dccf7
|
@ -87,7 +87,8 @@ public class SolrInfoMBeanHandler extends RequestHandlerBase {
|
||||||
cats = normalize(cats);
|
cats = normalize(cats);
|
||||||
|
|
||||||
// Only the changes
|
// Only the changes
|
||||||
rsp.add("solr-mbeans", getDiff(ref,cats));
|
boolean showAll = req.getParams().getBool("all", false);
|
||||||
|
rsp.add("solr-mbeans", getDiff(ref,cats, showAll));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rsp.add("solr-mbeans", cats);
|
rsp.add("solr-mbeans", cats);
|
||||||
|
@ -162,7 +163,11 @@ public class SolrInfoMBeanHandler extends RequestHandlerBase {
|
||||||
return cats;
|
return cats;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected NamedList<NamedList<NamedList<Object>>> getDiff(NamedList<NamedList<NamedList<Object>>> ref, NamedList<NamedList<NamedList<Object>>> now) {
|
protected NamedList<NamedList<NamedList<Object>>> getDiff(
|
||||||
|
NamedList<NamedList<NamedList<Object>>> ref,
|
||||||
|
NamedList<NamedList<NamedList<Object>>> now,
|
||||||
|
boolean includeAll ) {
|
||||||
|
|
||||||
NamedList<NamedList<NamedList<Object>>> changed = new NamedList<NamedList<NamedList<Object>>>();
|
NamedList<NamedList<NamedList<Object>>> changed = new NamedList<NamedList<NamedList<Object>>>();
|
||||||
|
|
||||||
// Cycle through each category
|
// Cycle through each category
|
||||||
|
@ -192,13 +197,21 @@ public class SolrInfoMBeanHandler extends RequestHandlerBase {
|
||||||
// System.out.println( "NOW: " + now_txt );
|
// System.out.println( "NOW: " + now_txt );
|
||||||
|
|
||||||
// Calculate the differences
|
// Calculate the differences
|
||||||
cat.add(name, diffNamedList(ref_bean,now_bean));
|
NamedList diff = diffNamedList(ref_bean,now_bean);
|
||||||
|
diff.add( "_changed_", true ); // flag the changed thing
|
||||||
|
cat.add(name, diff);
|
||||||
|
}
|
||||||
|
else if(includeAll) {
|
||||||
|
cat.add(name, ref_bean);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cat.size()>0) {
|
if(cat.size()>0) {
|
||||||
changed.add(category, cat);
|
changed.add(category, cat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(includeAll) {
|
||||||
|
changed.add(category, ref_cat);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return changed;
|
return changed;
|
||||||
|
|
Loading…
Reference in New Issue