hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject hadoop git commit: HDFS-14009. HttpFS: FileStatus#setSnapShotEnabledFlag throws InvocationTargetException when attribute set is emptySet. Contributed by Siyao Meng.
Date Fri, 19 Oct 2018 00:02:57 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-3.0 b34c650a4 -> 6a7bf9f85


HDFS-14009. HttpFS: FileStatus#setSnapShotEnabledFlag throws InvocationTargetException when
attribute set is emptySet. Contributed by Siyao Meng.

Signed-off-by: Wei-Chiu Chuang <weichiu@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/6a7bf9f8
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/6a7bf9f8
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/6a7bf9f8

Branch: refs/heads/branch-3.0
Commit: 6a7bf9f850b560eb01b2db78d04446c74b443b8f
Parents: b34c650
Author: Siyao Meng <smeng@cloudera.com>
Authored: Thu Oct 18 17:02:04 2018 -0700
Committer: Wei-Chiu Chuang <weichiu@apache.org>
Committed: Thu Oct 18 17:02:38 2018 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/fs/FileStatus.java         | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/6a7bf9f8/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
index bdfbd20..4d953c6 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileStatus.java
@@ -360,7 +360,11 @@ public class FileStatus implements Writable, Comparable<Object>,
    */
   public void setSnapShotEnabledFlag(boolean isSnapShotEnabled) {
     if (isSnapShotEnabled) {
-      attr.add(AttrFlags.SNAPSHOT_ENABLED);
+      if (attr == NONE) {
+        attr = EnumSet.of(AttrFlags.SNAPSHOT_ENABLED);
+      } else {
+        attr.add(AttrFlags.SNAPSHOT_ENABLED);
+      }
     } else {
       attr.remove(AttrFlags.SNAPSHOT_ENABLED);
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message