MCPcopy Create free account
hub / github.com/apache/solr / initLibs

Method initLibs

solr/core/src/java/org/apache/solr/core/SolrConfig.java:913–937  ·  view source on GitHub ↗
(SolrResourceLoader loader)

Source from the content-addressed store, hash-verified

911 throw new SolrException(
912 SolrException.ErrorCode.SERVER_ERROR, "Multiple plugins configured for type: " + type);
913 }
914
915 private void initLibs(SolrResourceLoader loader) {
916 // TODO Want to remove SolrResourceLoader.getInstancePath; it can be on a Standalone subclass.
917 // For Zk subclass, it's needed for the time being as well. We could remove that one if we
918 // remove "instancePath/lib" in SolrCloud. Can wait till 9.0.
919 Path instancePath = loader.getInstancePath();
920 List<URL> urls = new ArrayList<>();
921
922 Path libPath = instancePath.resolve("lib");
923 if (Files.exists(libPath)) {
924 try {
925 urls.addAll(SolrResourceLoader.getURLs(libPath));
926 } catch (IOException e) {
927 log.warn("Couldn't add files from {} to classpath: {}", libPath, e);
928 }
929 }
930 if (!urls.isEmpty()) {
931 loader.addToClassLoader(urls);
932 loader.reloadLuceneSPI();
933 }
934
935 List<ConfigNode> nodes = root.getAll("lib");
936 if (nodes != null && nodes.size() > 0) {
937 log.warn("<lib/> entries no longer supported in solrconfig.xml; ignoring...");
938 }
939 }
940

Callers 1

SolrConfigMethod · 0.95

Calls 11

getURLsMethod · 0.95
addToClassLoaderMethod · 0.80
reloadLuceneSPIMethod · 0.80
resolveMethod · 0.65
existsMethod · 0.65
getAllMethod · 0.65
sizeMethod · 0.65
getInstancePathMethod · 0.45
addAllMethod · 0.45
warnMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected