DRILL-1427: Failure to initialize storage plug-in results in complete failure of drill-bit initialization
Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/ebf47855 Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/ebf47855 Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/ebf47855 Branch: refs/heads/master Commit: ebf4785553488d2262f007458049c4d2ca19b8a6 Parents: a44cb91 Author: Aditya Kishore <adi...@maprtech.com> Authored: Mon Sep 29 14:54:11 2014 -0700 Committer: Steven Phillips <sphill...@maprtech.com> Committed: Mon Sep 29 18:21:45 2014 -0700 ---------------------------------------------------------------------- .../drill/exec/store/StoragePluginRegistry.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/ebf47855/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistry.java ---------------------------------------------------------------------- diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistry.java b/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistry.java index e0c14a3..d6c8ee0 100644 --- a/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistry.java +++ b/exec/java-exec/src/main/java/org/apache/drill/exec/store/StoragePluginRegistry.java @@ -161,14 +161,18 @@ public class StoragePluginRegistry implements Iterable<Map.Entry<String, Storage } Map<String, StoragePlugin> activePlugins = new HashMap<String, StoragePlugin>(); - for (Map.Entry<String, StoragePluginConfig> config : pluginSystemTable) { - try { - if (config.getValue().isEnabled()) { - StoragePlugin plugin = create(config.getKey(), config.getValue()); - activePlugins.put(config.getKey(), plugin); + for (Map.Entry<String, StoragePluginConfig> entry : pluginSystemTable) { + String name = entry.getKey(); + StoragePluginConfig config = entry.getValue(); + if (config.isEnabled()) { + try { + StoragePlugin plugin = create(name, config); + activePlugins.put(name, plugin); + } catch (ExecutionSetupException e) { + logger.error("Failure while setting up StoragePlugin with name: '{}', disabling.", name, e); + config.setEnabled(false); + pluginSystemTable.put(name, config); } - } catch (ExecutionSetupException e) { - logger.error("Failure while setting up StoragePlugin with name: '{}'.", config.getKey(), e); } }