From 9c591b4388056e904f5fa1db93e9fd0b94e8862a Mon Sep 17 00:00:00 2001 From: Maksym Rymar Date: Wed, 3 Jan 2024 06:13:34 +0200 Subject: [PATCH] DRILL-8468: Drill doesn't perform drill.exec.storage.action_on_plugins_override_file action (#2859) --- .../drill/exec/store/StoragePluginRegistryImpl.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistryImpl.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistryImpl.java index 31059005831..f4afc0f4780 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistryImpl.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistryImpl.java @@ -291,16 +291,14 @@ private void initStore() { try { for (ConnectorLocator locator : locators) { StoragePlugins locatorPlugins = locator.bootstrapPlugins(); - if (locatorPlugins != null) { - bootstrapPlugins.putAll(locatorPlugins); - } + bootstrapPlugins.putAll(locatorPlugins); } } catch (IOException e) { throw new IllegalStateException( "Failure initializing the plugin store. Drillbit exiting.", e); } pluginStore.putAll(bootstrapPlugins); - locators.stream().forEach(loc -> loc.onUpgrade()); + locators.forEach(ConnectorLocator::onUpgrade); } /** @@ -311,9 +309,7 @@ private void upgradeStore() { StoragePlugins upgraded = new StoragePlugins(); for (ConnectorLocator locator : locators) { StoragePlugins locatorPlugins = locator.updatedPlugins(); - if (upgraded != null) { - upgraded.putAll(locatorPlugins); - } + upgraded.putAll(locatorPlugins); } if (upgraded.isEmpty()) { return; @@ -325,6 +321,7 @@ private void upgradeStore() { } pluginStore.put(newPlugin.getKey(), newPlugin.getValue()); } + locators.forEach(ConnectorLocator::onUpgrade); } /**