lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Heisey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-8097) Implement a builder pattern for constructing a Solrj client
Date Tue, 09 Feb 2016 03:06:18 GMT

    [ https://issues.apache.org/jira/browse/SOLR-8097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15138268#comment-15138268
] 

Shawn Heisey commented on SOLR-8097:
------------------------------------

We get semi-regular questions about EmbeddedSolrServer on the mailing lists and sometimes
in the IRC channel.  Users ARE using it.

The reason I thought it could maybe use a builder pattern is that the way to create an instance
is kind of arcane and non-obvious ... but I suppose that could be called a feature, because
it might discourage people from using it.  The embedded server is not recommended for general
use, but it does make sense for certain highly specialized use cases.


> Implement a builder pattern for constructing a Solrj client
> -----------------------------------------------------------
>
>                 Key: SOLR-8097
>                 URL: https://issues.apache.org/jira/browse/SOLR-8097
>             Project: Solr
>          Issue Type: Improvement
>          Components: SolrJ
>    Affects Versions: Trunk
>            Reporter: Hrishikesh Gadre
>            Priority: Minor
>         Attachments: SOLR-8097.patch
>
>
> Currently Solrj clients (e.g. CloudSolrClient) supports multiple constructors as follows,
> public CloudSolrClient(String zkHost) 
> public CloudSolrClient(String zkHost, HttpClient httpClient) 
> public CloudSolrClient(Collection<String> zkHosts, String chroot)
> public CloudSolrClient(Collection<String> zkHosts, String chroot, HttpClient httpClient)
> public CloudSolrClient(String zkHost, boolean updatesToLeaders)
> public CloudSolrClient(String zkHost, boolean updatesToLeaders, HttpClient httpClient)
> It is kind of problematic while introducing an additional parameters (since we need to
introduce additional constructors). Instead it will be helpful to provide SolrClient Builder
which can provide either default values or support overriding specific parameter. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message