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
diff --git a/CHANGES.txt b/CHANGES.txt
index bcd5f6c..e1ae276 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -841,6 +841,9 @@
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
diff --git a/src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java b/src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java
index 16aa4fc..a82e19b 100644
--- a/src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java
+++ b/src/hdfs/org/apache/hadoop/hdfs/server/balancer/Balancer.java
@@ -372,7 +372,7 @@
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 @@
}
/* 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 @@
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 */