diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java index 293b0a7..a164b12 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/HiveMetaStoreChecker.java @@ -376,6 +376,7 @@ private void getAllLeafDirs(Path basePath, Set allDirs) throws IOException ConcurrentLinkedQueue basePaths = new ConcurrentLinkedQueue<>(); basePaths.add(basePath); // we only use the keySet of ConcurrentHashMap + // Neither the key nor the value can be null. Map dirSet = new ConcurrentHashMap<>(); // Here we just reuse the THREAD_COUNT configuration for // HIVE_MOVE_FILES_THREAD_COUNT @@ -410,7 +411,8 @@ private void getAllLeafDirs(final ExecutorService pool, final ConcurrentLinkedQu } if (!directoryFound) { - allDirs.put(path, null); + // true is just a boolean object place holder because neither the key nor the value can be null. + allDirs.put(path, true); } if (!nextLevel.isEmpty()) { getAllLeafDirs(pool, nextLevel, allDirs, fs); @@ -433,7 +435,7 @@ public Void call() throws Exception { } if (!directoryFound) { - allDirs.put(path, null); + allDirs.put(path, true); } return null; }