Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-8097

Implement a builder pattern for constructing a Solrj client

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 6.0
    • Fix Version/s: 6.1, 7.0
    • Component/s: SolrJ
    • Labels:
      None

      Description

      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.

        Attachments

        1. SOLR-8097.patch
          15 kB
          Jason Gerlowski
        2. SOLR-8097.patch
          29 kB
          Jason Gerlowski
        3. SOLR-8097.patch
          79 kB
          Jason Gerlowski
        4. SOLR-8097.patch
          86 kB
          Jason Gerlowski
        5. SOLR-8097.patch
          212 kB
          Jason Gerlowski
        6. SOLR-8097.patch
          162 kB
          Jason Gerlowski
        7. SOLR-8097.patch
          162 kB
          Jason Gerlowski
        8. SOLR-8097.patch
          161 kB
          Jason Gerlowski
        9. SOLR-8097.patch
          152 kB
          Jason Gerlowski
        10. SOLR-8097.patch
          152 kB
          Jason Gerlowski
        11. SOLR-8097.patch
          152 kB
          Jason Gerlowski
        12. SOLR-8097.patch
          221 kB
          Jason Gerlowski
        13. SOLR-8097.patch
          222 kB
          Jason Gerlowski
        14. SOLR-8097.patch
          221 kB
          Anshum Gupta

          Issue Links

            Activity

              People

              • Assignee:
                anshumg Anshum Gupta
                Reporter:
                hgadre Hrishikesh Gadre
              • Votes:
                0 Vote for this issue
                Watchers:
                13 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: