Explorar o código

HDFS-10731. FSDirectory#verifyMaxDirItems does not log path name. Contributed by Wei-Chiu Chuang.

(cherry picked from commit 9019606b69bfb7019c8642b6cbcbb93645cc19e3)
(cherry picked from commit 20a8ff0a8d17c05305f712da887ad6665eb654b5)
Wei-Chiu Chuang %!s(int64=8) %!d(string=hai) anos
pai
achega
53f097a474

+ 3 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/FSLimitException.java

@@ -87,8 +87,10 @@ public abstract class FSLimitException extends QuotaExceededException {
       super(msg);
       super(msg);
     }
     }
     
     
-    public MaxDirectoryItemsExceededException(long quota, long count) {
+    public MaxDirectoryItemsExceededException(String path, long quota,
+        long count) {
       super(quota, count);
       super(quota, count);
+      setPathName(path);
     }
     }
 
 
     @Override
     @Override

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java

@@ -1004,9 +1004,9 @@ public class FSDirectory implements Closeable {
     final int count = parent.getChildrenList(CURRENT_STATE_ID).size();
     final int count = parent.getChildrenList(CURRENT_STATE_ID).size();
     if (count >= maxDirItems) {
     if (count >= maxDirItems) {
       final MaxDirectoryItemsExceededException e
       final MaxDirectoryItemsExceededException e
-          = new MaxDirectoryItemsExceededException(maxDirItems, count);
+          = new MaxDirectoryItemsExceededException(parentPath, maxDirItems,
+          count);
       if (namesystem.isImageLoaded()) {
       if (namesystem.isImageLoaded()) {
-        e.setPathName(parentPath);
         throw e;
         throw e;
       } else {
       } else {
         // Do not throw if edits log is still being processed
         // Do not throw if edits log is still being processed