-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of classrealms and new plugin structure #13930
Conversation
…here should be different configuration for this instance
…st-classes/plugins
…ot you'll have "unlimited" mode, all classes will be looked up in the pinot-realm first.
Make pinot-plugin.properties required (as it is a markerfile to switch to classrealms)
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13930 +/- ##
============================================
- Coverage 61.75% 57.98% -3.77%
- Complexity 207 219 +12
============================================
Files 2436 2613 +177
Lines 133233 143275 +10042
Branches 20636 21992 +1356
============================================
+ Hits 82274 83084 +810
- Misses 44911 53700 +8789
- Partials 6048 6491 +443
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
pinot-spi/src/main/java/org/apache/pinot/spi/plugin/PluginManager.java
Outdated
Show resolved
Hide resolved
…inot into STP-3362_classrealms
pinot-spi/src/test/java/org/apache/pinot/spi/plugin/PluginManagerTest.java
Outdated
Show resolved
Hide resolved
pinot-spi/pom.xml
Outdated
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>3.7.1</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need to pin version for this plugin
private final Path _pluginsDirectory = Path.of("target/test-classes/plugins").toAbsolutePath(); | ||
|
||
// MathUtils is only used in pinot framework, should not be available in limited plugins | ||
private final String _commonsMathUtils = "org.apache.commons.math3.util.MathUtils"; | ||
|
||
// IOUtils exists in all realms, they should use their own version | ||
private final String _commonsIOUtils = "org.apache.commons.io.IOUtils"; | ||
|
||
// TimeUtils exists in all realms, they should be imported from pinot classloader | ||
private final String _spiTimeUtils = "org.apache.pinot.spi.utils.TimeUtils"; | ||
|
||
public final String _yammerMetricsRegistry = "org.apache.pinot.plugin.metrics.yammer.YammerMetricsRegistry"; | ||
|
||
public final String _dropwizardMetricsRegistry = | ||
"org.apache.pinot.plugin.metrics.dropwizard.DropwizardMetricsRegistry"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can be constants (i.e. static final
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has already been merged, so I'll leave this up to you
pinot-spi/src/test/java/org/apache/pinot/spi/plugin/ClassLoaderTest.java
Show resolved
Hide resolved
This is causing failure when releasing with commend: @rfscholte @gortiz Do you know how to fix this? |
With classrealms there will be much more control over the classloaders.
Next to the shaded plugins, a plugin-directory may contain a pinot-plugin.properties (to switch from PluginClassloader to ClassRealms).
if there is no
pinot-plugin.properties
, the original behavior is used.if there is a
pinot-plugin.properties
, a classrealm will be created: every direct file or directory in the plugin-directory will be added to the classrealm.It is possible to let shaded plugins use a classrealm. In that case the classes in the shaded jar will be loaded before the system classloader (as done by the PluginLoader).
this implementation doesn't unpack plugin-zips as created with the assembly descriptor. Instead is assumes it is unpacked before pinot starts.