hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sunc...@apache.org
Subject svn commit: r1666006 - /hive/trunk/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
Date Wed, 11 Mar 2015 20:47:41 GMT
Author: sunchao
Date: Wed Mar 11 20:47:40 2015
New Revision: 1666006

URL: http://svn.apache.org/r1666006
Log:
HIVE-9721 - Hadoop23Shims.setFullFileStatus should check for null (Sergio via Chao)

Modified:
    hive/trunk/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java

Modified: hive/trunk/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java
URL: http://svn.apache.org/viewvc/hive/trunk/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java?rev=1666006&r1=1666005&r2=1666006&view=diff
==============================================================================
--- hive/trunk/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java (original)
+++ hive/trunk/shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java Wed
Mar 11 20:47:40 2015
@@ -704,18 +704,20 @@ public class Hadoop23Shims extends Hadoo
         //Attempt extended Acl operations only if its enabled, 8791but don't fail the operation
regardless.
         try {
           AclStatus aclStatus = ((Hadoop23FileStatus) sourceStatus).getAclStatus();
-          List<AclEntry> aclEntries = aclStatus.getEntries();
-          removeBaseAclEntries(aclEntries);
+          if (aclStatus != null) {
+            List<AclEntry> aclEntries = aclStatus.getEntries();
+            removeBaseAclEntries(aclEntries);
 
-          //the ACL api's also expect the tradition user/group/other permission in the form
of ACL
-          FsPermission sourcePerm = sourceStatus.getFileStatus().getPermission();
-          aclEntries.add(newAclEntry(AclEntryScope.ACCESS, AclEntryType.USER, sourcePerm.getUserAction()));
-          aclEntries.add(newAclEntry(AclEntryScope.ACCESS, AclEntryType.GROUP, sourcePerm.getGroupAction()));
-          aclEntries.add(newAclEntry(AclEntryScope.ACCESS, AclEntryType.OTHER, sourcePerm.getOtherAction()));
+            //the ACL api's also expect the tradition user/group/other permission in the
form of ACL
+            FsPermission sourcePerm = sourceStatus.getFileStatus().getPermission();
+            aclEntries.add(newAclEntry(AclEntryScope.ACCESS, AclEntryType.USER, sourcePerm.getUserAction()));
+            aclEntries.add(newAclEntry(AclEntryScope.ACCESS, AclEntryType.GROUP, sourcePerm.getGroupAction()));
+            aclEntries.add(newAclEntry(AclEntryScope.ACCESS, AclEntryType.OTHER, sourcePerm.getOtherAction()));
 
-          //construct the -setfacl command
-          String aclEntry = Joiner.on(",").join(aclStatus.getEntries());
-          run(fsShell, new String[]{"-setfacl", "-R", "--set", aclEntry, target.toString()});
+            //construct the -setfacl command
+            String aclEntry = Joiner.on(",").join(aclStatus.getEntries());
+            run(fsShell, new String[]{"-setfacl", "-R", "--set", aclEntry, target.toString()});
+          }
         } catch (Exception e) {
           LOG.info("Skipping ACL inheritance: File system for path " + target + " " +
                   "does not support ACLs but dfs.namenode.acls.enabled is set to true: "
+ e, e);



Mime
View raw message