From 9019606b69bfb7019c8642b6cbcbb93645cc19e3 Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Thu, 11 Aug 2016 14:43:48 -0700 Subject: [PATCH] HDFS-10731. FSDirectory#verifyMaxDirItems does not log path name. Contributed by Wei-Chiu Chuang. --- .../org/apache/hadoop/hdfs/protocol/FSLimitException.java | 4 +++- .../org/apache/hadoop/hdfs/server/namenode/FSDirectory.java | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/FSLimitException.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/FSLimitException.java index 2ee11f0c378..347d8923d31 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/FSLimitException.java +++ b/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); } - public MaxDirectoryItemsExceededException(long quota, long count) { + public MaxDirectoryItemsExceededException(String path, long quota, + long count) { super(quota, count); + setPathName(path); } @Override diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java index b71b8d63949..11a7899b5a7 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirectory.java @@ -991,9 +991,9 @@ public class FSDirectory implements Closeable { final int count = parent.getChildrenList(CURRENT_STATE_ID).size(); if (count >= maxDirItems) { final MaxDirectoryItemsExceededException e - = new MaxDirectoryItemsExceededException(maxDirItems, count); + = new MaxDirectoryItemsExceededException(parentPath, maxDirItems, + count); if (namesystem.isImageLoaded()) { - e.setPathName(parentPath); throw e; } else { // Do not throw if edits log is still being processed