瀏覽代碼

HADOOP-6079. Serialize proxySource as DatanodeInfo in DataTransferProtocol.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/core/trunk@786278 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 16 年之前
父節點
當前提交
ed05c0d9b5
共有 2 個文件被更改,包括 5 次插入13 次删除
  1. 3 0
      CHANGES.txt
  2. 2 13
      src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java

+ 3 - 0
CHANGES.txt

@@ -841,6 +841,9 @@ Trunk (unreleased changes)
     HADOOP-6004. Fixes BlockLocation deserialization.  (Jakob Homan via
     szetszwo)
 
+    HADOOP-6079. Serialize proxySource as DatanodeInfo in DataTransferProtocol.
+    (szetszwo)
+
 Release 0.20.1 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 2 - 13
src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java

@@ -372,7 +372,7 @@ public class Balancer implements Tool {
       out.writeLong(block.getBlock().getBlockId());
       out.writeLong(block.getBlock().getGenerationStamp());
       Text.writeString(out, source.getStorageID());
-      proxySource.write(out);
+      proxySource.getDatanode().write(out);
       AccessToken accessToken = AccessToken.DUMMY_TOKEN;
       if (isAccessTokenEnabled) {
         accessToken = accessTokenHandler.generateToken(null, block.getBlock()
@@ -496,7 +496,7 @@ public class Balancer implements Tool {
   }
   
   /* A class that keeps track of a datanode in Balancer */
-  private static class BalancerDatanode implements Writable {
+  private static class BalancerDatanode {
     final private static long MAX_SIZE_TO_MOVE = 10*1024*1024*1024L; //10GB
     protected DatanodeInfo datanode;
     private double utilization;
@@ -584,17 +584,6 @@ public class Balancer implements Tool {
         PendingBlockMove pendingBlock) {
       return pendingBlocks.remove(pendingBlock);
     }
-
-    /** The following two methods support the Writable interface */
-    /** Deserialize */
-    public void readFields(DataInput in) throws IOException {
-      datanode.readFields(in);
-    }
-
-    /** Serialize */
-    public void write(DataOutput out) throws IOException {
-      datanode.write(out);
-    }
   }
   
   /** A node that can be the sources of a block move */