Class ZkSolrResourceLoader

java.lang.Object
org.apache.solr.core.SolrResourceLoader
org.apache.solr.cloud.ZkSolrResourceLoader
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.lucene.util.ResourceLoader, org.apache.solr.common.cloud.SolrClassLoader, SolrCoreAware

public class ZkSolrResourceLoader extends SolrResourceLoader
ResourceLoader that works with ZooKeeper.
  • Constructor Details

    • ZkSolrResourceLoader

      public ZkSolrResourceLoader(Path instanceDir, String configSet, ClassLoader parent, ZkController zooKeeperController)
      This loader will first attempt to load resources from ZooKeeper, but if not found will delegate to the context classloader when possible, otherwise it will attempt to resolve resources using any jar files found in the "lib/" directory in the specified instance directory.
  • Method Details

    • getZkResourceInfo

      public org.apache.solr.common.util.Pair<String,Integer> getZkResourceInfo(String resource)
    • openResource

      public InputStream openResource(String resource) throws IOException
      Opens any resource by its name. By default, this will look in multiple locations to load the resource: $configDir/$resource from ZooKeeper. It will look for it in any jar accessible through the class loader if it cannot be found in ZooKeeper. Override this method to customize loading resources.
      Specified by:
      openResource in interface org.apache.lucene.util.ResourceLoader
      Overrides:
      openResource in class SolrResourceLoader
      Returns:
      the stream for the named resource
      Throws:
      IOException
    • getConfigSetZkPath

      public String getConfigSetZkPath()
    • getZkController

      public ZkController getZkController()
    • setZkIndexSchemaReader

      public void setZkIndexSchemaReader(ZkIndexSchemaReader zkIndexSchemaReader)
    • getZkIndexSchemaReader

      public ZkIndexSchemaReader getZkIndexSchemaReader()