org.apache.solr.cloud
Class ZkSolrResourceLoader

java.lang.Object
  extended by org.apache.solr.core.SolrResourceLoader
      extended by org.apache.solr.cloud.ZkSolrResourceLoader
All Implemented Interfaces:
Closeable, ResourceLoader

public class ZkSolrResourceLoader
extends SolrResourceLoader

ResourceLoader that works with ZooKeeper.


Field Summary
 
Fields inherited from class org.apache.solr.core.SolrResourceLoader
classLoader, log
 
Constructor Summary
ZkSolrResourceLoader(String instanceDir, String collection, ClassLoader parent, Properties coreProperties, 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.
ZkSolrResourceLoader(String instanceDir, String collection, ZkController zooKeeperController)
           
 
Method Summary
 String getCollectionZkPath()
           
 String getConfigDir()
           
 ZkController getZkController()
           
 String[] listConfigDir()
           
 InputStream openResource(String resource)
          Opens any resource by its name.
 
Methods inherited from class org.apache.solr.core.SolrResourceLoader
close, findClass, findClass, getClassLoader, getCoreProperties, getDataDir, getInstanceDir, getLines, getLines, getLines, inform, inform, inform, locateSolrHome, newAdminHandlerInstance, newInstance, newInstance, newInstance, normalizeDir, openConfig, openSchema
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ZkSolrResourceLoader

public ZkSolrResourceLoader(String instanceDir,
                            String collection,
                            ZkController zooKeeperController)

ZkSolrResourceLoader

public ZkSolrResourceLoader(String instanceDir,
                            String collection,
                            ClassLoader parent,
                            Properties coreProperties,
                            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 Detail

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 ResourceLoader
Overrides:
openResource in class SolrResourceLoader
Returns:
the stream for the named resource
Throws:
IOException

getConfigDir

public String getConfigDir()
Overrides:
getConfigDir in class SolrResourceLoader

listConfigDir

public String[] listConfigDir()
Overrides:
listConfigDir in class SolrResourceLoader

getCollectionZkPath

public String getCollectionZkPath()

getZkController

public ZkController getZkController()


Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.