Repository: hadoop Updated Branches: refs/heads/branch-2 99b825569 -> e4cd67e9b
HDFS-7997. The first non-existing xattr should also throw IOException. (zhouyingchao via yliu) Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/e4cd67e9 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/e4cd67e9 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/e4cd67e9 Branch: refs/heads/branch-2 Commit: e4cd67e9b0bcc4e5aedb8c189dc780326c69b032 Parents: 99b8255 Author: yliu <[email protected]> Authored: Tue Mar 31 21:16:13 2015 +0800 Committer: yliu <[email protected]> Committed: Tue Mar 31 21:16:13 2015 +0800 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java | 3 ++- .../hadoop-hdfs/src/test/resources/testXAttrConf.xml | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/e4cd67e9/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 3d7690e..da3d729 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -77,6 +77,9 @@ Release 2.8.0 - UNRELEASED DatanodeDescriptor#updateHeartbeatState() (Brahma Reddy Battula via Colin P. McCabe) + HDFS-7997. The first non-existing xattr should also throw IOException. + (zhouyingchao via yliu) + Release 2.7.0 - UNRELEASED INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/e4cd67e9/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java index 45e63f2..d5c9124 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirXAttrOp.java @@ -108,7 +108,8 @@ class FSDirXAttrOp { return filteredAll; } if (filteredAll == null || filteredAll.isEmpty()) { - return null; + throw new IOException( + "At least one of the attributes provided was not found."); } List<XAttr> toGet = Lists.newArrayListWithCapacity(xAttrs.size()); for (XAttr xAttr : xAttrs) { http://git-wip-us.apache.org/repos/asf/hadoop/blob/e4cd67e9/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testXAttrConf.xml ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testXAttrConf.xml b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testXAttrConf.xml index 9c66cba..c2e836c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testXAttrConf.xml +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/resources/testXAttrConf.xml @@ -420,8 +420,8 @@ </cleanup-commands> <comparators> <comparator> - <type>ExactComparator</type> - <expected-output># file: /file1#LF#</expected-output> + <type>SubstringComparator</type> + <expected-output>At least one of the attributes provided was not found</expected-output> </comparator> </comparators> </test>
