-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Plugin manager rewrite as plugin installers #16082
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,7 +13,10 @@ | |
| */ | ||
| package io.trino.exchange; | ||
|
|
||
| import com.google.common.annotations.VisibleForTesting; | ||
| import io.airlift.log.Logger; | ||
| import io.trino.server.PluginInstaller; | ||
| import io.trino.spi.Plugin; | ||
| import io.trino.spi.TrinoException; | ||
| import io.trino.spi.classloader.ThreadContextClassLoader; | ||
| import io.trino.spi.exchange.ExchangeManager; | ||
|
|
@@ -37,6 +40,7 @@ | |
| import static java.util.Objects.requireNonNull; | ||
|
|
||
| public class ExchangeManagerRegistry | ||
| implements PluginInstaller | ||
| { | ||
| private static final Logger log = Logger.get(ExchangeManagerRegistry.class); | ||
|
|
||
|
|
@@ -47,6 +51,16 @@ public class ExchangeManagerRegistry | |
|
|
||
| private volatile ExchangeManager exchangeManager; | ||
|
|
||
| @Override | ||
| public void installPlugin(Plugin plugin) | ||
| { | ||
| for (ExchangeManagerFactory exchangeManagerFactory : plugin.getExchangeManagerFactories()) { | ||
| log.info("Registering exchange manager %s", exchangeManagerFactory.getName()); | ||
| addExchangeManagerFactory(exchangeManagerFactory); | ||
| } | ||
| } | ||
|
|
||
| @VisibleForTesting | ||
| public void addExchangeManagerFactory(ExchangeManagerFactory factory) | ||
|
||
| { | ||
| requireNonNull(factory, "factory is null"); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.