gerlowskija commented on code in PR #3270:
URL: https://github.com/apache/solr/pull/3270#discussion_r2007938592
##########
solr/solrj/src/java/org/apache/solr/client/solrj/SolrRequest.java:
##########
@@ -256,12 +257,15 @@ public RequestWriter.ContentWriter
getContentWriter(String expectedType) {
public final T process(SolrClient client, String collection)
throws SolrServerException, IOException {
long startNanos = System.nanoTime();
- T res = createResponse(client);
var namedList = client.request(this, collection);
- res.setResponse(namedList);
long endNanos = System.nanoTime();
- res.setElapsedTime(TimeUnit.NANOSECONDS.toMillis(endNanos - startNanos));
- return res;
+ final T typedResponse = createResponse(namedList);
+ // SolrResponse is pre-V2 API
+ if (typedResponse instanceof SolrResponse res) {
+ res.setResponse(namedList); // TODO insist createResponse does this ?
+ res.setElapsedTime(TimeUnit.NANOSECONDS.toMillis(endNanos - startNanos));
+ }
Review Comment:
OK, sounds good 👍
--
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]