Skip to content
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

Changed CompoundPinotMetricsFactory to use PluginManager instead of Class.forName #14402

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ public class CompoundPinotMetricsFactory implements PinotMetricsFactory {
* corresponding property prefix (like pinot.server.plugin.metrics, pinot.broker.plugin.metrics, etc).
*
* The list of metrics factory classes we want to ignore. They have to be actual names that can be converted into
* classes by using {@link Class#forName(String)}. Any {@link PinotMetricsRegistry} that is implements or extends any
* of the factories included here will be ignored by this metric registry.
* classes by using {@link PluginManager#loadClass(String)}. Any {@link PinotMetricsRegistry} that implements or
* extends any of the factories included here will be ignored by this metric registry.
*/
public static final String IGNORED_METRICS = "compound.ignored";
/**
Expand All @@ -103,7 +103,7 @@ public void init(PinotConfiguration metricsConfiguration) {
Set<Class<?>> allIgnored = metricsConfiguration.getProperty(IGNORED_METRICS, Collections.emptyList()).stream()
.flatMap(ignoredClassName -> {
try {
return Stream.of(Class.forName(ignoredClassName));
return Stream.of(PluginManager.get().loadClass(ignoredClassName));
} catch (ClassNotFoundException ex) {
LOGGER.warn("Ignored metric factory {} cannot be found", ignoredClassName);
return Stream.empty();
Expand Down
Loading