andywebb1975 commented on code in PR #875: URL: https://github.com/apache/solr/pull/875#discussion_r912515046
########## solr/core/src/java/org/apache/solr/core/QuerySenderListener.java: ########## @@ -102,4 +104,37 @@ public void close() {} } log.info("QuerySenderListener done."); } + + private static List<NamedList<Object>> convertQueriesToList(ArrayList<Object> queries) { + + List<NamedList<Object>> allLists = new ArrayList<NamedList<Object>>(); + + for (Object o : queries) { + if (o instanceof ArrayList) { + // XML config from solrconfig.xml triggers this path + for (Object o2 : (ArrayList) o) { + if (o2 instanceof NamedList) { + @SuppressWarnings("unchecked") + NamedList<Object> o3 = (NamedList<Object>) o2; + allLists.add(o3); + } else { + // this is triggered by unexpected <str> elements + // (unexpected <arr> is ignored) + // also by nested lists in JSON from Config API + log.warn("ignoring unsupported warming config ({})", o2); + } + } + } else if (o instanceof NamedList) { + // JSON config from Config API triggers this path + @SuppressWarnings("unchecked") + NamedList<Object> o3 = (NamedList<Object>) o; + allLists.add(o3); + } else { + // NB different message format to above so messages can be differentiated + log.warn("ignoring unsupported warming config - {}", o); Review Comment: I've dropped the 'TODO' I had here - haven't seen any way to trigger this `else` block but I think it'd useful to have the warning message, just in case. Happy to drop it! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org