dsmiley commented on code in PR #1211:
URL: https://github.com/apache/solr/pull/1211#discussion_r1039853213
##########
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:
Yes, you make a great point! In general, we don't want fields on
LBSolrClient and its subclasses (there are two) that are redundant with that of
the client/builder it delegates to. It'll add confusion as to which one is
real/used vs shadowed.
--
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]