HBASE-15109 HM/RS failed to start when "fs.hdfs.impl.disable.cache" is set to true (Pankaj Kumar)

This commit is contained in:
tedyu 2016-10-12 07:35:50 -07:00
parent 6db4ef8479
commit bf03827196
1 changed files with 5 additions and 4 deletions

View File

@ -199,10 +199,11 @@ public class ShutdownHook {
throw new RuntimeException("Client finalizer is null, can't suppress!");
}
synchronized (fsShutdownHooks) {
if (!fsShutdownHooks.containsKey(hdfsClientFinalizer) &&
!ShutdownHookManager.deleteShutdownHook(hdfsClientFinalizer)) {
throw new RuntimeException("Failed suppression of fs shutdown hook: " +
hdfsClientFinalizer);
boolean isFSCacheDisabled = fs.getConf().getBoolean("fs.hdfs.impl.disable.cache", false);
if (!isFSCacheDisabled && !fsShutdownHooks.containsKey(hdfsClientFinalizer)
&& !ShutdownHookManager.deleteShutdownHook(hdfsClientFinalizer)) {
throw new RuntimeException(
"Failed suppression of fs shutdown hook: " + hdfsClientFinalizer);
}
Integer refs = fsShutdownHooks.get(hdfsClientFinalizer);
fsShutdownHooks.put(hdfsClientFinalizer, refs == null ? 1 : refs + 1);