HDFS-11333. Print a user friendly error message when plugins are not found. Contributed by Wei-Chiu Chuang.
This commit is contained in:
parent
ff75132355
commit
859bd159ae
@ -921,7 +921,15 @@ private void startInfoServer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void startPlugins(Configuration conf) {
|
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) {
|
for (ServicePlugin p: plugins) {
|
||||||
try {
|
try {
|
||||||
p.start(this);
|
p.start(this);
|
||||||
|
@ -809,8 +809,15 @@ private void startCommonServices(Configuration conf) throws IOException {
|
|||||||
httpServer.setFSImage(getFSImage());
|
httpServer.setFSImage(getFSImage());
|
||||||
}
|
}
|
||||||
rpcServer.start();
|
rpcServer.start();
|
||||||
plugins = conf.getInstances(DFS_NAMENODE_PLUGINS_KEY,
|
try {
|
||||||
ServicePlugin.class);
|
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) {
|
for (ServicePlugin p: plugins) {
|
||||||
try {
|
try {
|
||||||
p.start(this);
|
p.start(this);
|
||||||
|
Loading…
Reference in New Issue
Block a user