diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 2458d74e036..c3a71ee8fdc 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -317,6 +317,8 @@ Release 2.0.0 - UNRELEASED HDFS-3199. TestValidateConfigurationSettings is failing. (todd via eli) + HDFS-3202. NamespaceInfo PB translation drops build version. (atm) + BREAKDOWN OF HDFS-1623 SUBTASKS HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java index 89102956ba9..d21a86d92f9 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/protocolPB/PBHelper.java @@ -384,7 +384,8 @@ public class PBHelper { public static NamespaceInfo convert(NamespaceInfoProto info) { StorageInfoProto storage = info.getStorageInfo(); return new NamespaceInfo(storage.getNamespceID(), storage.getClusterID(), - info.getBlockPoolID(), storage.getCTime(), info.getDistUpgradeVersion()); + info.getBlockPoolID(), storage.getCTime(), info.getDistUpgradeVersion(), + info.getBuildVersion()); } public static NamenodeCommand convert(NamenodeCommandProto cmd) { diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java index cc33a04d1e9..56cf74bb746 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/protocol/NamespaceInfo.java @@ -50,14 +50,19 @@ public class NamespaceInfo extends StorageInfo { super(); buildVersion = null; } - - public NamespaceInfo(int nsID, String clusterID, String bpID, - long cT, int duVersion) { + + public NamespaceInfo(int nsID, String clusterID, String bpID, + long cT, int duVersion, String buildVersion) { super(HdfsConstants.LAYOUT_VERSION, nsID, clusterID, cT); blockPoolID = bpID; - buildVersion = Storage.getBuildVersion(); + this.buildVersion = buildVersion; this.distributedUpgradeVersion = duVersion; } + + public NamespaceInfo(int nsID, String clusterID, String bpID, + long cT, int duVersion) { + this(nsID, clusterID, bpID, cT, duVersion, Storage.getBuildVersion()); + } public String getBuildVersion() { return buildVersion;