hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bo...@apache.org
Subject svn commit: r1344763 - /hadoop/common/trunk/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java
Date Thu, 31 May 2012 15:16:48 GMT
Author: bobby
Date: Thu May 31 15:16:48 2012
New Revision: 1344763

URL: http://svn.apache.org/viewvc?rev=1344763&view=rev
Log:
MAPREDUCE-4297. Usersmap file in gridmix should not fail on empty lines (Ravi Prakash via
bobby)

Modified:
    hadoop/common/trunk/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java

Modified: hadoop/common/trunk/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java?rev=1344763&r1=1344762&r2=1344763&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java
(original)
+++ hadoop/common/trunk/hadoop-tools/hadoop-gridmix/src/main/java/org/apache/hadoop/mapred/gridmix/RoundRobinUserResolver.java
Thu May 31 15:16:48 2012
@@ -68,15 +68,18 @@ public class RoundRobinUserResolver impl
     try {
       in = new LineReader(fs.open(userloc));
       while (in.readLine(rawUgi) > 0) {//line is of the form username[,group]*
+        if(rawUgi.toString().trim().equals("")) {
+          continue; //Continue on empty line
+        }
         // e is end position of user name in this line
         int e = rawUgi.find(",");
-        if (rawUgi.getLength() == 0 || e == 0) {
+        if (e == 0) {
           throw new IOException("Missing username: " + rawUgi);
         }
         if (e == -1) {
           e = rawUgi.getLength();
         }
-        final String username = Text.decode(rawUgi.getBytes(), 0, e);
+        final String username = Text.decode(rawUgi.getBytes(), 0, e).trim();
         UserGroupInformation ugi = null;
         try {
           ugi = UserGroupInformation.createProxyUser(username,



Mime
View raw message