stillalex commented on code in PR #1211:
URL: https://github.com/apache/solr/pull/1211#discussion_r1039812882


##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java:
##########
@@ -88,23 +89,63 @@ public LBHttp2SolrClient(Http2SolrClient httpClient, 
String... baseSolrUrls) {
     this.httpClient = httpClient;
   }
 
+  public LBHttp2SolrClient(Http2SolrClient httpClient, List<String> 
baseSolrUrls, Builder builder) {
+    super(baseSolrUrls);
+    this.httpClient = httpClient;
+    if (builder.responseParser != null) {
+      this.parser = builder.responseParser;
+    }
+    if (builder.requestWriter != null) {
+      this.httpClient.setRequestWriter(builder.requestWriter);
+    }
+  }
+
   @Override
   protected SolrClient getClient(String baseUrl) {
     return httpClient;
   }
 
+  /**
+   * Note: This setter method is <b>not thread-safe</b>.
+   *
+   * @param parser Default Response Parser chosen to parse the response if the 
parser were not
+   *     specified as part of the request.
+   * @see org.apache.solr.client.solrj.SolrRequest#getResponseParser()
+   * @deprecated use {@link 
LBHttp2SolrClient.Builder#withResponseParser(ResponseParser)} instead
+   */
+  @Deprecated
   @Override
   public void setParser(ResponseParser parser) {
     super.setParser(parser);
     this.httpClient.setParser(parser);
   }
 
+  @Override
+  public ResponseParser getParser() {
+    return httpClient.getParser();

Review Comment:
   this `getParser()` method overrides the one in the super class, then there 
is no need for the `super.setParser(parser);` on line 119 above. I would 
actually mark the LBSolrClient#setParser() method as deprecated too, to convey 
a clearer message. (and actually same for requestWriter)



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

Reply via email to