hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kih...@apache.org
Subject svn commit: r1503978 - in /hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src: main/java/org/apache/hadoop/tools/DistCh.java test/java/org/apache/hadoop/tools/TestDistCh.java
Date Wed, 17 Jul 2013 02:24:55 GMT
Author: kihwal
Date: Wed Jul 17 02:24:55 2013
New Revision: 1503978

URL: http://svn.apache.org/r1503978
Log:
svn merge -c 1503976 merging to branch-2 to fix HADOOP-9738. TestDistCh fails. Contributed
by Jing Zhao.

Modified:
    hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/main/java/org/apache/hadoop/tools/DistCh.java
    hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java

Modified: hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/main/java/org/apache/hadoop/tools/DistCh.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/main/java/org/apache/hadoop/tools/DistCh.java?rev=1503978&r1=1503977&r2=1503978&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/main/java/org/apache/hadoop/tools/DistCh.java
(original)
+++ hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/main/java/org/apache/hadoop/tools/DistCh.java
Wed Jul 17 02:24:55 2013
@@ -24,8 +24,6 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Stack;
 
-import javax.security.auth.login.LoginException;
-
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileSystem;
@@ -47,10 +45,7 @@ import org.apache.hadoop.mapred.OutputCo
 import org.apache.hadoop.mapred.RecordReader;
 import org.apache.hadoop.mapred.Reporter;
 import org.apache.hadoop.mapred.SequenceFileRecordReader;
-import org.apache.hadoop.mapreduce.Job;
 import org.apache.hadoop.mapreduce.JobSubmissionFiles;
-import org.apache.hadoop.mapreduce.jobhistory.JobSubmittedEvent;
-import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.StringUtils;
 import org.apache.hadoop.util.ToolRunner;
 

Modified: hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java?rev=1503978&r1=1503977&r2=1503978&view=diff
==============================================================================
--- hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java
(original)
+++ hadoop/common/branches/branch-2.1-beta/hadoop-tools/hadoop-extras/src/test/java/org/apache/hadoop/tools/TestDistCh.java
Wed Jul 17 02:24:55 2013
@@ -113,6 +113,8 @@ public class TestDistCh extends junit.fr
   }
 
   static class ChPermissionStatus extends PermissionStatus {
+    private final boolean defaultPerm;
+    
     ChPermissionStatus(FileStatus filestatus) {
       this(filestatus, "", "", "");
     }
@@ -121,6 +123,7 @@ public class TestDistCh extends junit.fr
       super("".equals(owner)? filestatus.getOwner(): owner, 
           "".equals(group)? filestatus.getGroup(): group,
           "".equals(permission)? filestatus.getPermission(): new FsPermission(Short.parseShort(permission,
8)));
+      defaultPerm = permission == null || "".equals(permission);
     }
   }
   
@@ -141,7 +144,7 @@ public class TestDistCh extends junit.fr
       runLsr(shell, tree.root, 0);
 
       final String[] args = new String[NUN_SUBS];
-      final PermissionStatus[] newstatus = new PermissionStatus[NUN_SUBS];
+      final ChPermissionStatus[] newstatus = new ChPermissionStatus[NUN_SUBS];
 
       
       args[0]="/test/testDistCh/sub0:sub1::";
@@ -185,13 +188,11 @@ public class TestDistCh extends junit.fr
     }
   }
 
- 
-
-  static void checkFileStatus(PermissionStatus expected, FileStatus actual) {
+  static void checkFileStatus(ChPermissionStatus expected, FileStatus actual) {
     assertEquals(expected.getUserName(), actual.getOwner());
     assertEquals(expected.getGroupName(), actual.getGroup());
-    FsPermission perm = expected.getPermission(); 
-    if (actual.isFile()) {
+    FsPermission perm = expected.getPermission();
+    if (actual.isFile() && expected.defaultPerm) {
       perm = perm.applyUMask(UMASK);
     }
     assertEquals(perm, actual.getPermission());



Mime
View raw message