From ec87b4bfe28fe4947b36172bdeba3bc61921e413 Mon Sep 17 00:00:00 2001 From: tedyu Date: Tue, 11 Oct 2016 15:37:26 -0700 Subject: [PATCH] HBASE-15109 HM/RS failed to start when "fs.hdfs.impl.disable.cache" is set to true (Pankaj Kumar) --- .../apache/hadoop/hbase/regionserver/ShutdownHook.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java index b5f37e85381..83e4ea86be5 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/ShutdownHook.java @@ -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);