HDFS-3202. NamespaceInfo PB translation drops build version. Contributed by Aaron T. Myers.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1309957 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Aaron Myers 2012-04-05 17:22:20 +00:00
parent 3a981de558
commit d13cb8a1d4
3 changed files with 13 additions and 5 deletions

View File

@ -317,6 +317,8 @@ Release 2.0.0 - UNRELEASED
HDFS-3199. TestValidateConfigurationSettings is failing. (todd via eli) HDFS-3199. TestValidateConfigurationSettings is failing. (todd via eli)
HDFS-3202. NamespaceInfo PB translation drops build version. (atm)
BREAKDOWN OF HDFS-1623 SUBTASKS BREAKDOWN OF HDFS-1623 SUBTASKS
HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd) HDFS-2179. Add fencing framework and mechanisms for NameNode HA. (todd)

View File

@ -384,7 +384,8 @@ public class PBHelper {
public static NamespaceInfo convert(NamespaceInfoProto info) { public static NamespaceInfo convert(NamespaceInfoProto info) {
StorageInfoProto storage = info.getStorageInfo(); StorageInfoProto storage = info.getStorageInfo();
return new NamespaceInfo(storage.getNamespceID(), storage.getClusterID(), 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) { public static NamenodeCommand convert(NamenodeCommandProto cmd) {

View File

@ -52,13 +52,18 @@ public class NamespaceInfo extends StorageInfo {
} }
public NamespaceInfo(int nsID, String clusterID, String bpID, public NamespaceInfo(int nsID, String clusterID, String bpID,
long cT, int duVersion) { long cT, int duVersion, String buildVersion) {
super(HdfsConstants.LAYOUT_VERSION, nsID, clusterID, cT); super(HdfsConstants.LAYOUT_VERSION, nsID, clusterID, cT);
blockPoolID = bpID; blockPoolID = bpID;
buildVersion = Storage.getBuildVersion(); this.buildVersion = buildVersion;
this.distributedUpgradeVersion = duVersion; 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() { public String getBuildVersion() {
return buildVersion; return buildVersion;
} }