diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index de05e6383d8..ba788c079de 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -70,6 +70,8 @@ Release 2.7.4 - UNRELEASED HDFS-10534. NameNode WebUI should display DataNode usage histogram. (Kai Sasaki via zhz) + HDFS-11333. Print a user friendly error message when plugins are not found. (Wei-Chiu Chuang) + OPTIMIZATIONS HDFS-10896. Move lock logging logic from FSNamesystem into FSNamesystemLock. diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java index 9ba64b4b213..12b3c9fdae0 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java @@ -769,7 +769,15 @@ public class DataNode extends ReconfigurableBase } private void startPlugins(Configuration conf) { - plugins = conf.getInstances(DFS_DATANODE_PLUGINS_KEY, ServicePlugin.class); + try { + plugins = conf.getInstances(DFS_DATANODE_PLUGINS_KEY, + ServicePlugin.class); + } catch (RuntimeException e) { + String pluginsValue = conf.get(DFS_DATANODE_PLUGINS_KEY); + LOG.error("Unable to load DataNode plugins. Specified list of plugins: " + + pluginsValue, e); + throw e; + } for (ServicePlugin p: plugins) { try { p.start(this); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java index 5bac79cf1a5..b90be7c8d15 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NameNode.java @@ -684,8 +684,15 @@ public class NameNode implements NameNodeStatusMXBean { httpServer.setFSImage(getFSImage()); } rpcServer.start(); - plugins = conf.getInstances(DFS_NAMENODE_PLUGINS_KEY, - ServicePlugin.class); + try { + plugins = conf.getInstances(DFS_NAMENODE_PLUGINS_KEY, + ServicePlugin.class); + } catch (RuntimeException e) { + String pluginsValue = conf.get(DFS_NAMENODE_PLUGINS_KEY); + LOG.error("Unable to load NameNode plugins. Specified list of plugins: " + + pluginsValue, e); + throw e; + } for (ServicePlugin p: plugins) { try { p.start(this);