arina-ielchiieva commented on a change in pull request #1780: DRILL-7030: Make
format plugins fully pluggable
URL: https://github.com/apache/drill/pull/1780#discussion_r280834121
##########
File path:
exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistryImpl.java
##########
@@ -310,22 +311,18 @@ public void addPluginToPersistentStoreIfAbsent(String
name, StoragePluginConfig
private StoragePlugins loadBootstrapPlugins(LogicalPlanPersistence
lpPersistence) throws IOException {
// bootstrap load the config since no plugins are stored.
logger.info("No storage plugin instances configured in persistent store,
loading bootstrap configuration.");
- Set<URL> urls =
ClassPathScanner.forResource(ExecConstants.BOOTSTRAP_STORAGE_PLUGINS_FILE,
false);
- if (urls != null && !urls.isEmpty()) {
- logger.info("Loading the storage plugin configs from URLs {}.", urls);
+ Set<URL> storageUrls =
ClassPathScanner.forResource(ExecConstants.BOOTSTRAP_STORAGE_PLUGINS_FILE,
false);
+ Set<URL> formatUrls =
ClassPathScanner.forResource(ExecConstants.BOOTSTRAP_FORMAT_PLUGINS_FILE,
false);
+ if (storageUrls != null && !storageUrls.isEmpty()) {
+ logger.info("Loading the storage plugin configs from URLs {}.",
storageUrls);
StoragePlugins bootstrapPlugins = new StoragePlugins(new HashMap<>());
Map<String, URL> pluginURLMap = new HashMap<>();
- for (URL url : urls) {
- String pluginsData = Resources.toString(url, Charsets.UTF_8);
- StoragePlugins plugins =
lpPersistence.getMapper().readValue(pluginsData, StoragePlugins.class);
- for (Entry<String, StoragePluginConfig> plugin : plugins) {
- StoragePluginConfig oldPluginConfig =
bootstrapPlugins.putIfAbsent(plugin.getKey(), plugin.getValue());
- if (oldPluginConfig != null) {
- logger.warn("Duplicate plugin instance '{}' defined in [{}, {}],
ignoring the later one.",
- plugin.getKey(), pluginURLMap.get(plugin.getKey()), url);
- } else {
- pluginURLMap.put(plugin.getKey(), url);
- }
+ for (URL url : storageUrls) {
Review comment:
add log info, similar as for storage plugins
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services