Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-14654: remove all references of runtime lib

Noble Paul2f651b156c47
diff --git a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
index fc7ca3b6e2e..0b97896f504 100644
--- a/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SolrConfigHandler.java
@@ -598,26 +598,23 @@ public class SolrConfigHandler extends RequestHandlerBase implements SolrCoreAwa
@SuppressWarnings({"unchecked"})
private boolean verifyClass(CommandOperation op, String clz, @SuppressWarnings({"rawtypes"})Class expected) {
if (clz == null) return true;
- if (!"true".equals(String.valueOf(op.getStr("runtimeLib", null)))) {
- PluginInfo info = new PluginInfo(SolrRequestHandler.TYPE, op.getDataMap());
- //this is not dynamically loaded so we can verify the class right away
- try {
- if(expected == Expressible.class) {
- @SuppressWarnings("resource")
- SolrResourceLoader resourceLoader = info.pkgName == null ?
- req.getCore().getResourceLoader() :
- req.getCore().getResourceLoader(info.pkgName);
- resourceLoader.findClass(info.className, expected);
- } else {
- req.getCore().createInitInstance(info, expected, clz, "");
- }
- } catch (Exception e) {
- log.error("Error checking plugin : ", e);
- op.addError(e.getMessage());
- return false;
+ PluginInfo info = new PluginInfo(SolrRequestHandler.TYPE, op.getDataMap());
+ try {
+ if (expected == Expressible.class) {
+ @SuppressWarnings("resource")
+ SolrResourceLoader resourceLoader = info.pkgName == null ?
+ req.getCore().getResourceLoader() :
+ req.getCore().getResourceLoader(info.pkgName);
+ resourceLoader.findClass(info.className, expected);
+ } else {
+ req.getCore().createInitInstance(info, expected, clz, "");
}
-
+ } catch (Exception e) {
+ log.error("Error checking plugin : ", e);
+ op.addError(e.getMessage());
+ return false;
}
+
return true;
}
diff --git a/solr/core/src/test/org/apache/solr/core/TestCustomStream.java b/solr/core/src/test/org/apache/solr/core/TestCustomStream.java
index 856c865d6c1..5fc4242ec26 100644
--- a/solr/core/src/test/org/apache/solr/core/TestCustomStream.java
+++ b/solr/core/src/test/org/apache/solr/core/TestCustomStream.java
@@ -19,11 +19,8 @@ package org.apache.solr.core;
import java.util.Arrays;
-import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.cloud.AbstractFullDistribZkTestBase;
-import org.apache.solr.handler.TestBlobHandler;
import org.apache.solr.util.RestTestHarness;
-import org.junit.BeforeClass;
import org.junit.Test;
/**
@@ -31,25 +28,9 @@ import org.junit.Test;
*/
public class TestCustomStream extends AbstractFullDistribZkTestBase {
- @BeforeClass
- public static void enableRuntimeLib() throws Exception {
- System.setProperty("enable.runtime.lib", "true");
- }
-
@Test
public void testDynamicLoadingCustomStream() throws Exception {
- System.setProperty("enable.runtime.lib", "true");
setupRestTestHarnesses();
-
- String blobName = "colltest";
-
- HttpSolrClient randomClient = (HttpSolrClient) clients.get(random().nextInt(clients.size()));
- String baseURL = randomClient.getBaseURL();
- baseURL = baseURL.substring(0, baseURL.lastIndexOf('/'));
-
- TestBlobHandler.createSystemCollection(getHttpSolrClient(baseURL, randomClient.getHttpClient()));
- waitForRecoveriesToFinish(".system", true);
-
String payload = "{\n" +
"'create-expressible' : { 'name' : 'hello', 'class': 'org.apache.solr.core.HelloStream' }\n" +
"}";
diff --git a/solr/solrj/src/resources/apispec/core.config.Commands.addRequestHandler.properties.json b/solr/solrj/src/resources/apispec/core.config.Commands.addRequestHandler.properties.json
index 731c3d85791..2d4b59f5fc5 100644
--- a/solr/solrj/src/resources/apispec/core.config.Commands.addRequestHandler.properties.json
+++ b/solr/solrj/src/resources/apispec/core.config.Commands.addRequestHandler.properties.json
@@ -9,10 +9,6 @@
"type": "string",
"description": "The request handler class. Class names do not need to be fully qualified if they are included with Solr, so you can abbreviate the name as 'solr.SearchHandler'. Custom or third-party class names may need to be fully qualified, however."
},
- "runtimeLib": {
- "type": "boolean",
- "description": "An optional parameter to use a custom .jar file that has been uploaded to Solr's blobstore. This additionally requires that the .jar has also been registered with the 'add-runtimelib' command, which is one of the available commands for the Config API."
- },
"startup": {
"type": "string",
"description": "Allows the request handler to only start when requested. The only option is 'lazy'.",
diff --git a/solr/solrj/src/resources/apispec/core.config.Commands.generic.json b/solr/solrj/src/resources/apispec/core.config.Commands.generic.json
index 9d2b01d03a4..ca95a65c007 100644
--- a/solr/solrj/src/resources/apispec/core.config.Commands.generic.json
+++ b/solr/solrj/src/resources/apispec/core.config.Commands.generic.json
@@ -8,10 +8,6 @@
"class": {
"type": "string",
"description": "The configuration item class. Class names do not need to be fully qualified if they are included with Solr, so you can abbreviate the name as 'solr.SearchHandler'. Custom or third-party class names may need to be fully qualified, however."
- },
- "runtimeLib": {
- "type": "boolean",
- "description": "An optional parameter to use a custom .jar file that has been uploaded to Solr's blobstore. This additionally requires that the .jar has also been registered with the 'add-runtimelib' command, which is one of the available commands for the Config API."
}
},
"required": [ "name", "class"],
diff --git a/solr/solrj/src/resources/apispec/core.config.Commands.json b/solr/solrj/src/resources/apispec/core.config.Commands.json
index 392c149d8b0..e3a18acb320 100644
--- a/solr/solrj/src/resources/apispec/core.config.Commands.json
+++ b/solr/solrj/src/resources/apispec/core.config.Commands.json
@@ -197,19 +197,6 @@
"items": {
"type": "string"
}
- },
- "add-runtimelib": {
- "#include": "core.config.Commands.runtimeLib"
- },
- "update-runtimelib": {
- "#include": "core.config.Commands.runtimeLib"
- },
- "delete-runtimelib": {
- "type":"array",
- "description": "Deletes one or more runtime libraries (runtimeLibs), using the name given when the runtimeLib was created. Define more than one runtimeLibs by separating the list of names with commas.",
- "items": {
- "type": "string"
- }
}
}
}