hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r784849 - in /hadoop/core/branches/HADOOP-3628-2/src: core/org/apache/hadoop/util/Service.java hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Date Mon, 15 Jun 2009 16:29:27 GMT
Author: stevel
Date: Mon Jun 15 16:29:27 2009
New Revision: 784849

URL: http://svn.apache.org/viewvc?rev=784849&view=rev
Log:
HADOOP-3628: better handling of thrown IOEs, reduce the diff in FSNameSystem

Modified:
    hadoop/core/branches/HADOOP-3628-2/src/core/org/apache/hadoop/util/Service.java
    hadoop/core/branches/HADOOP-3628-2/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java

Modified: hadoop/core/branches/HADOOP-3628-2/src/core/org/apache/hadoop/util/Service.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/HADOOP-3628-2/src/core/org/apache/hadoop/util/Service.java?rev=784849&r1=784848&r2=784849&view=diff
==============================================================================
--- hadoop/core/branches/HADOOP-3628-2/src/core/org/apache/hadoop/util/Service.java (original)
+++ hadoop/core/branches/HADOOP-3628-2/src/core/org/apache/hadoop/util/Service.java Mon Jun
15 16:29:27 2009
@@ -668,12 +668,18 @@
       service.closeQuietly();
       throw e;
     } catch (Throwable t) {
-        //mark as failed
-        service.enterFailedState(t);
-        //we assume that the service really does know how to terminate
-        service.closeQuietly();
-        //and wrap the exception in an IOException that is rethrown
+      //mark as failed
+      service.enterFailedState(t);
+      //we assume that the service really does know how to terminate
+      service.closeQuietly();
+      
+      if (t instanceof IOException) {
+        //rethrow any IOException
+        throw (IOException) t;
+      } else {
+        //and wrap any other exception in an IOException that is rethrown
         throw (IOException) new IOException(t.toString()).initCause(t);
+      }
     }
   }
 

Modified: hadoop/core/branches/HADOOP-3628-2/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
URL: http://svn.apache.org/viewvc/hadoop/core/branches/HADOOP-3628-2/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java?rev=784849&r1=784848&r2=784849&view=diff
==============================================================================
--- hadoop/core/branches/HADOOP-3628-2/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
(original)
+++ hadoop/core/branches/HADOOP-3628-2/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java
Mon Jun 15 16:29:27 2009
@@ -106,7 +106,7 @@
       }
   };
 
-  private static void logAuditEvent(UserGroupInformation ugi,
+  private static final void logAuditEvent(UserGroupInformation ugi,
       InetAddress addr, String cmd, String src, String dst,
       FileStatus stat) {
     final Formatter fmt = auditFormatter.get();



Mime
View raw message