Class KafkaCrossDcConsumer.SolrClientSupplier
- java.lang.Object
-
- org.apache.solr.crossdc.manager.consumer.KafkaCrossDcConsumer.SolrClientSupplier
-
- All Implemented Interfaces:
AutoCloseable
,Supplier<org.apache.solr.client.solrj.impl.CloudSolrClient>
- Enclosing class:
- KafkaCrossDcConsumer
public static class KafkaCrossDcConsumer.SolrClientSupplier extends Object implements Supplier<org.apache.solr.client.solrj.impl.CloudSolrClient>, AutoCloseable
Supplier for creating and managing a working CloudSolrClient instance. This class ensures that the CloudSolrClient instance doesn't try to use itsZkClientClusterStateProvider
in a closed state, which may happen if e.g. the ZooKeeper connection is lost. When this happens the CloudSolrClient is re-created to ensure it can continue to function properly.TODO: this functionality should be moved to the CloudSolrClient itself.
-
-
Constructor Summary
Constructors Constructor Description SolrClientSupplier(String zkConnectString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected org.apache.solr.client.solrj.impl.CloudSolrClient
createSolrClient()
org.apache.solr.client.solrj.impl.CloudSolrClient
get()
-
-
-
Constructor Detail
-
SolrClientSupplier
public SolrClientSupplier(String zkConnectString)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
createSolrClient
protected org.apache.solr.client.solrj.impl.CloudSolrClient createSolrClient()
-
-