hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject svn commit: r1543293 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java src/main/java/org/apache/hadoop/hdfs/tools/TableListing.java
Date Tue, 19 Nov 2013 02:35:35 GMT
Author: cmccabe
Date: Tue Nov 19 02:35:34 2013
New Revision: 1543293

URL: http://svn.apache.org/r1543293
Log:
HDFS-5512. CacheAdmin -listPools fails with NPE when user lacks permissions to view all pools
(awang via cmccabe)

Modified:
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java
    hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/TableListing.java

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1543293&r1=1543292&r2=1543293&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Tue Nov 19 02:35:34 2013
@@ -378,6 +378,9 @@ Trunk (Unreleased)
     HDFS-5520. loading cache path directives from edit log doesn't update
     nextEntryId (cmccabe)
 
+    HDFS-5512. CacheAdmin -listPools fails with NPE when user lacks permissions
+    to view all pools (awang via cmccabe)
+
 Release 2.3.0 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java?rev=1543293&r1=1543292&r2=1543293&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/CacheAdmin.java
Tue Nov 19 02:35:34 2013
@@ -741,14 +741,15 @@ public class CacheAdmin extends Configur
         RemoteIterator<CachePoolInfo> iter = dfs.listCachePools();
         while (iter.hasNext()) {
           CachePoolInfo info = iter.next();
+          String[] row = new String[5];
           if (name == null || info.getPoolName().equals(name)) {
-            listing.addRow(new String[] {
-                info.getPoolName(),
-                info.getOwnerName(),
-                info.getGroupName(),
-                info.getMode().toString(),
-                info.getWeight().toString(),
-            });
+            row[0] = info.getPoolName();
+            row[1] = info.getOwnerName();
+            row[2] = info.getGroupName();
+            row[3] = info.getMode() != null ? info.getMode().toString() : null;
+            row[4] =
+                info.getWeight() != null ? info.getWeight().toString() : null;
+            listing.addRow(row);
             ++numResults;
             if (name != null) {
               break;

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/TableListing.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/TableListing.java?rev=1543293&r1=1543292&r2=1543293&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/TableListing.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/tools/TableListing.java
Tue Nov 19 02:35:34 2013
@@ -59,6 +59,9 @@ public class TableListing {
     }
 
     private void addRow(String val) {
+      if (val == null) {
+        val = "";
+      }
       if ((val.length() + 1) > maxWidth) {
         maxWidth = val.length() + 1;
       }



Mime
View raw message