Package org.apache.solr.cloud
Class ZkSolrResourceLoader
- java.lang.Object
-
- org.apache.solr.core.SolrResourceLoader
-
- org.apache.solr.cloud.ZkSolrResourceLoader
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,org.apache.lucene.analysis.util.ResourceLoader
public class ZkSolrResourceLoader extends SolrResourceLoader
ResourceLoader that works with ZooKeeper.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ZkSolrResourceLoader.ZkByteArrayInputStream
-
Field Summary
-
Fields inherited from class org.apache.solr.core.SolrResourceLoader
classLoader
-
-
Constructor Summary
Constructors Constructor Description ZkSolrResourceLoader(Path instanceDir, String configSet, 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(Path instanceDir, String configSet, ZkController zooKeeperController)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getConfigDir()
String
getConfigSetZkPath()
ZkController
getZkController()
ZkIndexSchemaReader
getZkIndexSchemaReader()
String[]
listConfigDir()
InputStream
openResource(String resource)
Opens any resource by its name.void
setZkIndexSchemaReader(ZkIndexSchemaReader zkIndexSchemaReader)
-
Methods inherited from class org.apache.solr.core.SolrResourceLoader
close, findClass, findClass, getClassLoader, getCoreProperties, getDataDir, getFilteredURLs, getInfoMBeans, getInstancePath, getLines, getLines, getLines, getManagedResourceRegistry, getURLs, getURLs, inform, inform, inform, locateSolrHome, newAdminHandlerInstance, newInstance, newInstance, newInstance, normalizeDir, openConfig, openSchema, persistConfLocally, resourceLocation
-
-
-
-
Constructor Detail
-
ZkSolrResourceLoader
public ZkSolrResourceLoader(Path instanceDir, String configSet, ZkController zooKeeperController)
-
ZkSolrResourceLoader
public ZkSolrResourceLoader(Path instanceDir, String configSet, 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 interfaceorg.apache.lucene.analysis.util.ResourceLoader
- Overrides:
openResource
in classSolrResourceLoader
- Returns:
- the stream for the named resource
- Throws:
IOException
-
getConfigDir
public String getConfigDir()
- Overrides:
getConfigDir
in classSolrResourceLoader
-
listConfigDir
public String[] listConfigDir()
- Overrides:
listConfigDir
in classSolrResourceLoader
-
getConfigSetZkPath
public String getConfigSetZkPath()
-
getZkController
public ZkController getZkController()
-
setZkIndexSchemaReader
public void setZkIndexSchemaReader(ZkIndexSchemaReader zkIndexSchemaReader)
-
getZkIndexSchemaReader
public ZkIndexSchemaReader getZkIndexSchemaReader()
-
-