hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1215366 - in /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs: CHANGES.txt src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
Date Sat, 17 Dec 2011 00:26:46 GMT
Author: suresh
Date: Sat Dec 17 00:26:46 2011
New Revision: 1215366

URL: http://svn.apache.org/viewvc?rev=1215366&view=rev
Log:
HDFS-2687. Tests failing with ClassCastException post protobuf RPC changes. Contributed by
Suresh Srinivas.


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/protocolPB/PBHelper.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=1215366&r1=1215365&r2=1215366&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Sat Dec 17 00:26:46 2011
@@ -172,6 +172,9 @@ Trunk (unreleased changes)
 
     HDFS-2694. Removal of Avro broke non-PB NN services. (atm)
 
+    HDFS-2687. Tests failing with ClassCastException post protobuf RPC
+    changes. (suresh)
+
 Release 0.23.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java?rev=1215366&r1=1215365&r2=1215366&view=diff
==============================================================================
--- hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
(original)
+++ hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java
Sat Dec 17 00:26:46 2011
@@ -988,25 +988,15 @@ public class PBHelper {
   public static HdfsFileStatus convert(HdfsFileStatusProto fs) {
     if (fs == null)
       return null;
-    if (fs.hasLocations()) {
-      return new HdfsLocatedFileStatus(
-          fs.getLength(), fs.getFileType().equals(FileType.IS_DIR), 
-          fs.getBlockReplication(), fs.getBlocksize(),
-          fs.getModificationTime(), fs.getAccessTime(),
-          PBHelper.convert(fs.getPermission()), fs.getOwner(), fs.getGroup(), 
-          fs.getFileType().equals(FileType.IS_SYMLINK) ? 
-              fs.getSymlink().toByteArray() : null,
-          fs.getPath().toByteArray(),
-          PBHelper.convert(fs.hasLocations() ? fs.getLocations() : null));
-    }
-    return new HdfsFileStatus(
-      fs.getLength(), fs.getFileType().equals(FileType.IS_DIR), 
-      fs.getBlockReplication(), fs.getBlocksize(),
-      fs.getModificationTime(), fs.getAccessTime(),
-      PBHelper.convert(fs.getPermission()), fs.getOwner(), fs.getGroup(), 
-      fs.getFileType().equals(FileType.IS_SYMLINK) ? 
-          fs.getSymlink().toByteArray() : null,
-      fs.getPath().toByteArray());
+    return new HdfsLocatedFileStatus(
+        fs.getLength(), fs.getFileType().equals(FileType.IS_DIR), 
+        fs.getBlockReplication(), fs.getBlocksize(),
+        fs.getModificationTime(), fs.getAccessTime(),
+        PBHelper.convert(fs.getPermission()), fs.getOwner(), fs.getGroup(), 
+        fs.getFileType().equals(FileType.IS_SYMLINK) ? 
+            fs.getSymlink().toByteArray() : null,
+        fs.getPath().toByteArray(),
+        fs.hasLocations() ? PBHelper.convert(fs.getLocations()) : null);
   }
 
   public static HdfsFileStatusProto convert(HdfsFileStatus fs) {
@@ -1068,7 +1058,7 @@ public class PBHelper {
       return null;
     List<HdfsFileStatusProto> partList =  dl.getPartialListingList();
     return new DirectoryListing( 
-        partList.isEmpty() ? new HdfsFileStatus[0] 
+        partList.isEmpty() ? new HdfsLocatedFileStatus[0] 
           : PBHelper.convert(
               partList.toArray(new HdfsFileStatusProto[partList.size()])),
         dl.getRemainingEntries());
@@ -1214,7 +1204,8 @@ public class PBHelper {
   public static CorruptFileBlocks convert(CorruptFileBlocksProto c) {
     if (c == null)
       return null;
-    return new CorruptFileBlocks((String[]) c.getFilesList().toArray(),
+    List<String> fileList = c.getFilesList();
+    return new CorruptFileBlocks(fileList.toArray(new String[fileList.size()]),
         c.getCookie());
   }
 



Mime
View raw message