From aa9e43ef08fe6a3378ed53a4981b1e16a12d8073 Mon Sep 17 00:00:00 2001 From: Eli Collins Date: Fri, 30 Mar 2012 17:52:39 +0000 Subject: [PATCH] HDFS-3138. svn merge -c 1307553 from trunk git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1307555 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 2 ++ .../java/org/apache/hadoop/hdfs/protocol/DatanodeID.java | 3 ++- .../org/apache/hadoop/hdfs/protocol/DatanodeInfo.java | 8 -------- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 0f45fbf8936..b446bff5204 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -9,6 +9,8 @@ Release 2.0.0 - UNRELEASED HDFS-2303. Unbundle jsvc. (Roman Shaposhnik and Mingjie Lai via eli) HDFS-3137. Bump LAST_UPGRADABLE_LAYOUT_VERSION to -16. (eli) + + HDFS-3138. Move DatanodeInfo#ipcPort to DatanodeID. (eli) NEW FEATURES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java index 9c837d291f4..1b8ce5bff10 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeID.java @@ -170,7 +170,6 @@ public class DatanodeID implements WritableComparable { name = nodeReg.getName(); infoPort = nodeReg.getInfoPort(); ipcPort = nodeReg.getIpcPort(); - // update any more fields added in future. } /** Comparable. @@ -190,6 +189,7 @@ public class DatanodeID implements WritableComparable { DeprecatedUTF8.writeString(out, name); DeprecatedUTF8.writeString(out, storageID); out.writeShort(infoPort); + out.writeShort(ipcPort); } @Override @@ -201,5 +201,6 @@ public class DatanodeID implements WritableComparable { // So chop off the first two bytes (and hence the signed bits) before // setting the field. this.infoPort = in.readShort() & 0x0000ffff; + this.ipcPort = in.readShort() & 0x0000ffff; } } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java index 2065ae1d1eb..418f32db16f 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocol/DatanodeInfo.java @@ -380,10 +380,6 @@ public class DatanodeInfo extends DatanodeID implements Node { @Override public void write(DataOutput out) throws IOException { super.write(out); - - //TODO: move it to DatanodeID once DatanodeID is not stored in FSImage - out.writeShort(ipcPort); - out.writeLong(capacity); out.writeLong(dfsUsed); out.writeLong(remaining); @@ -398,10 +394,6 @@ public class DatanodeInfo extends DatanodeID implements Node { @Override public void readFields(DataInput in) throws IOException { super.readFields(in); - - //TODO: move it to DatanodeID once DatanodeID is not stored in FSImage - this.ipcPort = in.readShort() & 0x0000ffff; - this.capacity = in.readLong(); this.dfsUsed = in.readLong(); this.remaining = in.readLong();