stillalex commented on code in PR #1211:
URL: https://github.com/apache/solr/pull/1211#discussion_r1039884568
##########
solr/solrj/src/java/org/apache/solr/client/solrj/impl/LBHttp2SolrClient.java:
##########
@@ -258,4 +299,32 @@ public void onFailure(Throwable oe) {
}
});
}
+
+ public static class Builder {
+ private final Http2SolrClient http2Client;
+ private final String[] baseSolrUrls;
+ private ResponseParser responseParser;
+ private RequestWriter requestWriter;
+
+ public Builder(Http2SolrClient http2Client, String... baseSolrUrls) {
+ this.http2Client = http2Client;
+ this.baseSolrUrls = baseSolrUrls;
+ }
+
+ /** Provides a {@link ResponseParser} for created clients to use when
handling requests. */
+ public LBHttp2SolrClient.Builder withResponseParser(ResponseParser
responseParser) {
+ this.responseParser = responseParser;
+ return this;
+ }
+
+ /** Provides a {@link RequestWriter} for created clients to use when
handing requests. */
+ public LBHttp2SolrClient.Builder withRequestWriter(RequestWriter
requestWriter) {
+ this.requestWriter = requestWriter;
+ return this;
+ }
Review Comment:
there is a lot of overlap with the other discussion thread (I created some
of that confusion, sorry). I agree with @dsmiley here. if we don't expect the
response parser to be different (which it doesn't look like we do), we can
assume the client is already 'well configured' via its own builder and do not
expose these extra methods on this builder.
--
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]