dsmiley commented on a change in pull request #589:
URL: https://github.com/apache/solr/pull/589#discussion_r799811504
##########
File path:
solr/core/src/test/org/apache/solr/handler/admin/ThreadDumpHandlerTest.java
##########
@@ -245,21 +253,18 @@ public void doTestOwnableSync(final boolean
checkWaitingThreadViaPolling) throws
}
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> readProperties() throws Exception {
+ private void request(String path, Consumer<NamedList<?>> consumer) throws
Exception {
SolrClient client = new EmbeddedSolrServer(h.getCore());
-
- NamedList<Object> properties = client.request(new
GenericSolrRequest(SolrRequest.METHOD.GET, "/admin/info/threads",
- new ModifiableSolrParams()));
- return properties;
+ ModifiableSolrParams mparams = new ModifiableSolrParams();
+ mparams.set("indent", true);
+ NamedList<?> rsp = client.request(new
GenericSolrRequest(SolrRequest.METHOD.GET, path, mparams));
+ consumer.accept(rsp);
}
- @SuppressWarnings({"unchecked"})
- private NamedList<Object> getThread(NamedList<Object> threads, String
threadName) {
- for (Map.Entry<String, Object> threadEntry : threads) {
- @SuppressWarnings({"unchecked"})
- NamedList<Object> thread = (NamedList<Object>) threadEntry.getValue();
- if (thread._getStr("name", null).contains(threadName)) {
+ private NamedList<?> getThreadInfo(NamedList<?> req, String threadName) {
+ for (Map.Entry<String, ?> threadInfoEntry : (NamedList<?>)
req._get("system/threadDump", null)) {
Review comment:
```suggestion
private NamedList<?> getThreadInfo(NamedList<?> rsp, String threadName) {
for (Map.Entry<String, ?> threadInfoEntry : (NamedList<?>)
rsp._get("system/threadDump", null)) {
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]