lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Heisey (JIRA)" <>
Subject [jira] [Commented] (SOLR-7127) Add method to CloudSolrClient to create per-collection clients
Date Fri, 20 Feb 2015 17:44:13 GMT


Shawn Heisey commented on SOLR-7127:

After a quick glance, paying particular attention to the newly added methods, I have a couple
of questions/comments:

 * Although it's private, I think the new constructor should have javadoc explaining what
it does and why it exists.  The parameter named "parent" is a REALLY big clue, but this is
going to very likely be around for years, and time makes everything fuzzy.  A code review
will make the reason apparent, but comments always make that go faster.
 * Should the getCollectionClient method verify that the named collection exists and throw
a runtime error if it doesn't?  I *can* foresee a possible situation where somebody might
initialize code that creates a client for a collection that won't exist until later (through
some kind of "disable" feature that won't actually try to use that client right away), but
I think there's a lot of value to the idea of failing fast & hard when you have the capability
(via the zookeeper connection) of verifying the input immediately.

> Add method to CloudSolrClient to create per-collection clients
> --------------------------------------------------------------
>                 Key: SOLR-7127
>                 URL:
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Alan Woodward
>            Assignee: Alan Woodward
>            Priority: Minor
>         Attachments: SOLR-7127.patch, SOLR-7127.patch
> CloudSolrClient isn't thread-safe if you're making requests to multiple collections,
because defaultCollection is mutable.  This can be a pain if you're trying to index into multiple
collections from a single queue of documents.
> This issue adds a .getCollectionClient(String) method to CloudSolrClient that returns
a child client directed at that collection.  Under the hood it's another CloudSolrClient sharing
it's resources with the parent client, but with a separate default collection set.  The method
returns a SolrClient, however, so you can't then change the collection unless you explicitly
cast it.
> Sort of related to what I wanted to do on SOLR-6894, but this is more focussed.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message