Class 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 its ZkClientClusterStateProvider 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 Detail

      • SolrClientSupplier

        public SolrClientSupplier​(String zkConnectString)
    • Method Detail

      • createSolrClient

        protected org.apache.solr.client.solrj.impl.CloudSolrClient createSolrClient()
      • get

        public org.apache.solr.client.solrj.impl.CloudSolrClient get()
        Specified by:
        get in interface Supplier<org.apache.solr.client.solrj.impl.CloudSolrClient>