瀏覽代碼

HDFS-2666. Fix TestBackupNode failure. Contributed by Suresh Srinivas.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1213808 13f79535-47bb-0310-9956-ffa450edef68
Suresh Srinivas 13 年之前
父節點
當前提交
4ec8424e5d

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -34,6 +34,8 @@ Trunk (unreleased changes)
 
 
     HDFS-2663. Handle protobuf optional parameters correctly. (suresh)
     HDFS-2663. Handle protobuf optional parameters correctly. (suresh)
 
 
+    HDFS-2666. Fix TestBackupNode failure. (suresh)
+
   IMPROVEMENTS
   IMPROVEMENTS
 
 
     HADOOP-7524 Change RPC to allow multiple protocols including multuple 
     HADOOP-7524 Change RPC to allow multiple protocols including multuple 

+ 6 - 3
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java

@@ -343,16 +343,19 @@ public class PBHelper {
 
 
   public static CheckpointCommandProto convert(CheckpointCommand cmd) {
   public static CheckpointCommandProto convert(CheckpointCommand cmd) {
     return CheckpointCommandProto.newBuilder()
     return CheckpointCommandProto.newBuilder()
-        .setSignature(convert(cmd.getSignature())).build();
+        .setSignature(convert(cmd.getSignature()))
+        .setNeedToReturnImage(cmd.needToReturnImage()).build();
   }
   }
 
 
   public static NamenodeCommandProto convert(NamenodeCommand cmd) {
   public static NamenodeCommandProto convert(NamenodeCommand cmd) {
     if (cmd instanceof CheckpointCommand) {
     if (cmd instanceof CheckpointCommand) {
       return NamenodeCommandProto.newBuilder().setAction(cmd.getAction())
       return NamenodeCommandProto.newBuilder().setAction(cmd.getAction())
-          .setType(NamenodeCommandProto.Type.NamenodeCommand)
+          .setType(NamenodeCommandProto.Type.CheckPointCommand)
           .setCheckpointCmd(convert((CheckpointCommand) cmd)).build();
           .setCheckpointCmd(convert((CheckpointCommand) cmd)).build();
     }
     }
-    return NamenodeCommandProto.newBuilder().setAction(cmd.getAction()).build();
+    return NamenodeCommandProto.newBuilder()
+        .setType(NamenodeCommandProto.Type.NamenodeCommand)
+        .setAction(cmd.getAction()).build();
   }
   }
 
 
   public static BlockKey[] convertBlockKeys(List<BlockKeyProto> list) {
   public static BlockKey[] convertBlockKeys(List<BlockKeyProto> list) {