You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Boman <bi...@apttus.com> on 2016/05/05 00:10:21 UTC
getZkStateReader() returning NULL
I am attempting to check for existence of a collection prior to creating a
new one with that name, using Solrj:
System.out.println("Checking for existence of collection...");
ZkStateReader zkStateReader = this.server.getZkStateReader();
zkStateReader.updateClusterState();
this.server was created using:
this.server = new CloudSolrClient(this.ZK_HOST);
The call: this.server.getZkStateReader() consistently returns a NULL.
Any help would be appreciated. Thanks.
--
View this message in context: http://lucene.472066.n3.nabble.com/getZkStateReader-returning-NULL-tp4274663.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: getZkStateReader() returning NULL
Posted by Alan Woodward <al...@flax.co.uk>.
You'll need to call this.server.connect() - the state reader is instantiated lazily.
Alan Woodward
www.flax.co.uk
On 5 May 2016, at 01:10, Boman wrote:
> I am attempting to check for existence of a collection prior to creating a
> new one with that name, using Solrj:
>
> System.out.println("Checking for existence of collection...");
> ZkStateReader zkStateReader = this.server.getZkStateReader();
> zkStateReader.updateClusterState();
>
> this.server was created using:
>
> this.server = new CloudSolrClient(this.ZK_HOST);
>
> The call: this.server.getZkStateReader() consistently returns a NULL.
>
> Any help would be appreciated. Thanks.
>
>
>
> --
> View this message in context: http://lucene.472066.n3.nabble.com/getZkStateReader-returning-NULL-tp4274663.html
> Sent from the Solr - User mailing list archive at Nabble.com.