rfscholte commented on code in PR #13845:
URL: https://github.com/apache/pinot/pull/13845#discussion_r1723316719


##########
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginManager.java:
##########
@@ -244,9 +272,64 @@ public void load(String pluginName, File directory) {
         LOGGER.error("Unable to load plugin [{}] jar file [{}]", pluginName, 
jarFile, e);
       }
     }
-    PluginClassLoader classLoader = createClassLoader(urlList);
+
+    if (useLegacyPluginClassloader()) {
+      PluginClassLoader classLoader = createClassLoader(urlList);
+      _registry.put(new Plugin(pluginName), classLoader);
+    } else {
+      try {
+        ClassRealm pluginRealm = _classWorld.newRealm(
+                pluginName,
+                new URLClassLoader(urlList.toArray(new URL[0]), 
ClassLoader.getPlatformClassLoader()));
+
+        ClassLoader pinotLoader = _classWorld.getClassRealm("pinot");
+
+        // All exported packages
+        Stream.of("org.apache.pinot.spi.accounting",

Review Comment:
   This list is an assumption. Plugins should only make use of classes in these 
packages, which is any inside the pinot-spi module. Any other pinot-packages 
will not be accessible.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to