hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject hadoop git commit: HDFS-7419. Improve error messages for DataNode hot swap drive feature (Lei Xu via Colin P. Mccabe) (cherry picked from commit f636f9d9439742d7ebaaf21f7e22652403572c61)
Date Mon, 24 Nov 2014 18:58:11 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 946df98dc -> 4435ac9af


HDFS-7419. Improve error messages for DataNode hot swap drive feature (Lei Xu via Colin P.
Mccabe)
(cherry picked from commit f636f9d9439742d7ebaaf21f7e22652403572c61)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4435ac9a
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4435ac9a
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4435ac9a

Branch: refs/heads/branch-2
Commit: 4435ac9af5667869e3c5a080d07431a569a44085
Parents: 946df98
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Mon Nov 24 10:51:18 2014 -0800
Committer: Colin Patrick Mccabe <cmccabe@cloudera.com>
Committed: Mon Nov 24 10:58:05 2014 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/conf/ReconfigurableBase.java     | 2 +-
 .../java/org/apache/hadoop/conf/TestReconfiguration.java    | 5 +++--
 .../org/apache/hadoop/hdfs/server/datanode/DataNode.java    | 9 +++++----
 3 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4435ac9a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java
index 3248b9a..3664549 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/ReconfigurableBase.java
@@ -128,7 +128,7 @@ public abstract class ReconfigurableBase
         try {
           this.parent.reconfigurePropertyImpl(change.prop, change.newVal);
         } catch (ReconfigurationException e) {
-          errorMessage = e.toString();
+          errorMessage = e.getCause().getMessage();
         }
         results.put(change, Optional.fromNullable(errorMessage));
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4435ac9a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java
index 07b26eb..238ebda 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestReconfiguration.java
@@ -389,7 +389,8 @@ public class TestReconfiguration {
         .reconfigurePropertyImpl(eq("name1"), anyString());
     doNothing().when(dummy)
         .reconfigurePropertyImpl(eq("name2"), anyString());
-    doThrow(new ReconfigurationException("NAME3", "NEW3", "OLD3"))
+    doThrow(new ReconfigurationException("NAME3", "NEW3", "OLD3",
+        new IOException("io exception")))
         .when(dummy).reconfigurePropertyImpl(eq("name3"), anyString());
 
     dummy.startReconfigurationTask();
@@ -406,7 +407,7 @@ public class TestReconfiguration {
         assertThat(result.getValue().get(),
             containsString("Property name2 is not reconfigurable"));
       } else if (change.prop.equals("name3")) {
-        assertThat(result.getValue().get(), containsString("NAME3"));
+        assertThat(result.getValue().get(), containsString("io exception"));
       } else {
         fail("Unknown property: " + change.prop);
       }

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4435ac9a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
index 7d49511..62895fd 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DataNode.java
@@ -449,7 +449,7 @@ public class DataNode extends ReconfigurableBase
       try {
         LOG.info("Reconfiguring " + property + " to " + newVal);
         this.refreshVolumes(newVal);
-      } catch (Exception e) {
+      } catch (IOException e) {
         throw new ReconfigurationException(property, newVal,
             getConf().get(property), e);
       }
@@ -584,14 +584,15 @@ public class DataNode extends ReconfigurableBase
             IOException ioe = ioExceptionFuture.get();
             if (ioe != null) {
               errorMessageBuilder.append(String.format("FAILED TO ADD: %s: %s\n",
-                  volume.toString(), ioe.getMessage()));
+                  volume, ioe.getMessage()));
+              LOG.error("Failed to add volume: " + volume, ioe);
             } else {
               effectiveVolumes.add(volume.toString());
+              LOG.info("Successfully added volume: " + volume);
             }
-            LOG.info("Storage directory is loaded: " + volume.toString());
           } catch (Exception e) {
             errorMessageBuilder.append(String.format("FAILED to ADD: %s: %s\n",
-                volume.toString(), e.getMessage()));
+                volume, e.getMessage()));
           }
         }
       }


Mime
View raw message