From ea1c5ea0866fe6cccbae851e3eb8b9fd564258bf Mon Sep 17 00:00:00 2001 From: Arpit Agarwal Date: Thu, 14 Nov 2013 18:16:02 +0000 Subject: [PATCH] HDFS-5510. Fix a findbug warning in DataStorage.java on HDFS-2832 branch. (Contributed by Junping Du) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-2832@1542006 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt | 3 +++ .../org/apache/hadoop/hdfs/server/datanode/DataStorage.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt index 485f782c7f..0bb1ae9401 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES_HDFS-2832.txt @@ -104,3 +104,6 @@ IMPROVEMENTS: HDFS-5501. Fix pendingReceivedRequests tracking in BPServiceActor. (Arpit Agarwal) + HDFS-5510. Fix a findbug warning in DataStorage.java on HDFS-2832 branch. + (Junping Du via Arpit Agarwal) + diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java index aad857c0ea..819c7342b4 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataStorage.java @@ -291,9 +291,10 @@ protected void setPropertiesFromFields(Properties props, props.setProperty("layoutVersion", String.valueOf(layoutVersion)); props.setProperty("storageID", sd.getStorageUuid()); + String datanodeUuid = getDatanodeUuid(); if (LayoutVersion.supports(Feature.ADD_DATANODE_AND_STORAGE_UUIDS, layoutVersion) && datanodeUuid != null) { - props.setProperty("datanodeUuid", getDatanodeUuid()); + props.setProperty("datanodeUuid", datanodeUuid); } // Set NamespaceID in version before federation