CaoManhDat commented on a change in pull request #1688:
URL: https://github.com/apache/lucene-solr/pull/1688#discussion_r463483998



##########
File path: 
solr/solrj/src/java/org/apache/solr/client/solrj/impl/BaseCloudSolrClient.java
##########
@@ -838,6 +840,17 @@ public RouteException(ErrorCode errorCode, 
NamedList<Throwable> throwables, Map<
 
   @Override
   public NamedList<Object> request(@SuppressWarnings({"rawtypes"})SolrRequest 
request, String collection) throws SolrServerException, IOException {
+    return makeRequest(request, collection, null);
+  }
+
+  /**
+   * Will execute a request synchronously if asyncListener is null, 
asynchronously otherwise.
+   *
+   * @return A {@link NamedList} with the response if sync, or a {@link 
NamedList} containing a single Cancellable object if async
+   */
+  NamedList<Object> makeRequest(SolrRequest<?> request,
+                                String collection,
+                                AsyncListener<LBSolrClient.Rsp> asyncListener) 
throws SolrServerException, IOException {

Review comment:
       I think it makes sense to split into 2 different methods, return 
NamedList<Object> when asyncListener != null doesn't make sense. It also 
prevent cancelling async request.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to