hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tanp...@apache.org
Subject svn commit: r1139123 - in /hadoop/common/trunk/common: ./ src/java/org/apache/hadoop/fs/ src/java/org/apache/hadoop/io/retry/ src/java/org/apache/hadoop/io/serializer/ src/java/org/apache/hadoop/ipc/ src/java/org/apache/hadoop/metrics/util/ src/java/or...
Date Thu, 23 Jun 2011 23:55:31 GMT
Author: tanping
Date: Thu Jun 23 23:55:30 2011
New Revision: 1139123

URL: http://svn.apache.org/viewvc?rev=1139123&view=rev
Log:
HADOOP-7385 Remove StringUtils.stringifyException(ie) in logger functions.  Contributed by
Bharath Mundlapudi.

Modified:
    hadoop/common/trunk/common/CHANGES.txt
    hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFs.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/FileUtil.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/LocalDirAllocator.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/Trash.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/io/serializer/SerializationFactory.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/ipc/Server.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsIntValue.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingLong.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/net/ScriptBasedMapping.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/net/SocketIOWithTimeout.java
    hadoop/common/trunk/common/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
    hadoop/common/trunk/common/src/test/core/org/apache/hadoop/security/token/delegation/TestDelegationToken.java

Modified: hadoop/common/trunk/common/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/CHANGES.txt?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/CHANGES.txt (original)
+++ hadoop/common/trunk/common/CHANGES.txt Thu Jun 23 23:55:30 2011
@@ -227,6 +227,9 @@ Trunk (unreleased changes)
     HADOOP-6929. RPC should have a way to pass Security information other than 
     protocol annotations. (sharad and omalley via mahadev)
 
+    HADOOP-7385. Remove StringUtils.stringifyException(ie) in logger functions.
+    (Bharath Mundlapudi via Tanping Wang).
+
   OPTIMIZATIONS
   
     HADOOP-7333. Performance improvement in PureJavaCrc32. (Eric Caspole

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFileSystem.java Thu Jun
23 23:55:30 2011
@@ -151,8 +151,7 @@ public abstract class ChecksumFileSystem
         set(fs.verifyChecksum, null, 1, 0);
       } catch (IOException e) {                   // loudly ignore
         LOG.warn("Problem opening checksum file: "+ file + 
-                 ".  Ignoring exception: " + 
-                 StringUtils.stringifyException(e));
+                 ".  Ignoring exception: " , e); 
         set(fs.verifyChecksum, null, 1, 0);
       }
     }

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFs.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFs.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFs.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/ChecksumFs.java Thu Jun 23 23:55:30
2011
@@ -142,8 +142,7 @@ public abstract class ChecksumFs extends
         set(fs.verifyChecksum, null, 1, 0);
       } catch (IOException e) {                   // loudly ignore
         LOG.warn("Problem opening checksum file: "+ file + 
-                 ".  Ignoring exception: " + 
-                 StringUtils.stringifyException(e));
+                 ".  Ignoring exception: " , e); 
         set(fs.verifyChecksum, null, 1, 0);
       }
     }

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/FileUtil.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/FileUtil.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/FileUtil.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/FileUtil.java Thu Jun 23 23:55:30
2011
@@ -652,9 +652,9 @@ public class FileUtil {
     try {
       shExec.execute();
     }catch(Exception e) {
-      if(LOG.isDebugEnabled()) {
-        LOG.debug("Error while changing permission : " + filename 
-            +" Exception: " + StringUtils.stringifyException(e));
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Error while changing permission : " + filename
+            + " Exception: ", e);
       }
     }
     return shExec.getExitCode();

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/LocalDirAllocator.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/LocalDirAllocator.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/LocalDirAllocator.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/LocalDirAllocator.java Thu Jun
23 23:55:30 2011
@@ -232,15 +232,14 @@ public class LocalDirAllocator {
                 dirs.add(localDirs[i]);
                 dfList.add(new DF(new File(localDirs[i]), 30000));
               } catch (DiskErrorException de) {
-                LOG.warn( localDirs[i] + "is not writable\n" +
-                    StringUtils.stringifyException(de));
+                LOG.warn( localDirs[i] + "is not writable\n", de);
               }
             } else {
               LOG.warn( "Failed to create " + localDirs[i]);
             }
           } catch (IOException ie) { 
             LOG.warn( "Failed to create " + localDirs[i] + ": " +
-                ie.getMessage() + "\n" + StringUtils.stringifyException(ie));
+                ie.getMessage() + "\n", ie);
           } //ignore
         }
         localDirs = dirs.toArray(new String[dirs.size()]);
@@ -261,7 +260,7 @@ public class LocalDirAllocator {
         DiskChecker.checkDir(new File(file.getParent().toUri().getPath()));
         return file;
       } catch (DiskErrorException d) {
-        LOG.warn(StringUtils.stringifyException(d));
+        LOG.warn("Disk Error Exception: ", d);
         return null;
       }
     }

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/Trash.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/Trash.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/Trash.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/fs/Trash.java Thu Jun 23 23:55:30
2011
@@ -327,15 +327,13 @@ public class Trash extends Configured {
             }
           }
         } catch (Exception e) {
-          LOG.warn("RuntimeException during Trash.Emptier.run() " + 
-                   StringUtils.stringifyException(e));
+          LOG.warn("RuntimeException during Trash.Emptier.run(): ", e); 
         }
       }
       try {
         fs.close();
       } catch(IOException e) {
-        LOG.warn("Trash cannot close FileSystem. " +
-            StringUtils.stringifyException(e));
+        LOG.warn("Trash cannot close FileSystem: ", e);
       }
     }
 

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
(original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/io/retry/RetryInvocationHandler.java
Thu Jun 23 23:55:30 2011
@@ -61,7 +61,7 @@ class RetryInvocationHandler implements 
         if (!policy.shouldRetry(e, retries++)) {
           LOG.info("Exception while invoking " + method.getName()
                    + " of " + implementation.getClass() + ". Not retrying."
-                   + StringUtils.stringifyException(e));
+                   , e);
           if (!method.getReturnType().equals(Void.TYPE)) {
             throw e; // non-void methods can't fail without an exception
           }
@@ -70,7 +70,7 @@ class RetryInvocationHandler implements 
         if(LOG.isDebugEnabled()) {
           LOG.debug("Exception while invoking " + method.getName()
               + " of " + implementation.getClass() + ". Retrying."
-              + StringUtils.stringifyException(e));
+              , e);
         }
       }
     }

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/io/serializer/SerializationFactory.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/io/serializer/SerializationFactory.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/io/serializer/SerializationFactory.java
(original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/io/serializer/SerializationFactory.java
Thu Jun 23 23:55:30 2011
@@ -71,8 +71,7 @@ public class SerializationFactory extend
       serializations.add((Serialization)
 	  ReflectionUtils.newInstance(serializionClass, getConf()));
     } catch (ClassNotFoundException e) {
-      LOG.warn("Serialization class not found: " +
-          StringUtils.stringifyException(e));
+      LOG.warn("Serialization class not found: ", e);
     }
   }
 

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/ipc/Server.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/ipc/Server.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/ipc/Server.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/ipc/Server.java Thu Jun 23 23:55:30
2011
@@ -1501,7 +1501,7 @@ public abstract class Server {
                   );
             }
           } catch (Throwable e) {
-            LOG.info(getName()+", call "+call+": error: " + e, e);
+            LOG.info(getName() + ", call: " + call + ", error: ", e);
             errorClass = e.getClass().getName();
             error = StringUtils.stringifyException(e);
             // Remove redundant error class name from the beginning of the stack trace

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsIntValue.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsIntValue.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsIntValue.java
(original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsIntValue.java
Thu Jun 23 23:55:30 2011
@@ -97,8 +97,7 @@ public class MetricsIntValue extends Met
       try {
         mr.setMetric(getName(), value);
       } catch (Exception e) {
-        LOG.info("pushMetric failed for " + getName() + "\n" +
-            StringUtils.stringifyException(e));
+        LOG.info("pushMetric failed for " + getName() + "\n", e);
       }
     }
     changed = false;

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java
(original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingInt.java
Thu Jun 23 23:55:30 2011
@@ -106,8 +106,7 @@ public class MetricsTimeVaryingInt exten
     try {
       mr.incrMetric(getName(), getPreviousIntervalValue());
     } catch (Exception e) {
-      LOG.info("pushMetric failed for " + getName() + "\n" +
-          StringUtils.stringifyException(e));
+      LOG.info("pushMetric failed for " + getName() + "\n" , e);
     }
   }
   

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingLong.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingLong.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingLong.java
(original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingLong.java
Thu Jun 23 23:55:30 2011
@@ -102,8 +102,7 @@ public class MetricsTimeVaryingLong exte
     try {
       mr.incrMetric(getName(), getPreviousIntervalValue());
     } catch (Exception e) {
-      LOG.info("pushMetric failed for " + getName() + "\n" +
-          StringUtils.stringifyException(e));
+      LOG.info("pushMetric failed for " + getName() + "\n" , e);
     }
   }
   

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java
(original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/metrics/util/MetricsTimeVaryingRate.java
Thu Jun 23 23:55:30 2011
@@ -150,8 +150,7 @@ public class MetricsTimeVaryingRate exte
       mr.incrMetric(getName() + "_num_ops", getPreviousIntervalNumOps());
       mr.setMetric(getName() + "_avg_time", getPreviousIntervalAverageTime());
     } catch (Exception e) {
-      LOG.info("pushMetric failed for " + getName() + "\n" +
-          StringUtils.stringifyException(e));
+      LOG.info("pushMetric failed for " + getName() + "\n" , e);
     }
   }
   

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/net/ScriptBasedMapping.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/net/ScriptBasedMapping.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/net/ScriptBasedMapping.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/net/ScriptBasedMapping.java Thu
Jun 23 23:55:30 2011
@@ -156,7 +156,7 @@ implements Configurable
         s.execute();
         allOutput.append(s.getOutput() + " ");
       } catch (Exception e) {
-        LOG.warn(StringUtils.stringifyException(e));
+        LOG.warn("Exception: ", e);
         return null;
       }
       loopCount++; 

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/net/SocketIOWithTimeout.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/net/SocketIOWithTimeout.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/net/SocketIOWithTimeout.java (original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/net/SocketIOWithTimeout.java Thu
Jun 23 23:55:30 2011
@@ -288,8 +288,7 @@ abstract class SocketIOWithTimeout {
           try {
             selector.close();
           } catch (IOException e) {
-            LOG.warn("Unexpected exception while closing selector : " +
-                     StringUtils.stringifyException(e));
+            LOG.warn("Unexpected exception while closing selector : ", e);
           }
         }
       }    
@@ -361,8 +360,7 @@ abstract class SocketIOWithTimeout {
         try {
           info.selector.selectNow();
         } catch (IOException e) {
-          LOG.info("Unexpected Exception while clearing selector : " +
-                   StringUtils.stringifyException(e));
+          LOG.info("Unexpected Exception while clearing selector : ", e);
           // don't put the selector back.
           info.close();
           return ret; 

Modified: hadoop/common/trunk/common/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
(original)
+++ hadoop/common/trunk/common/src/java/org/apache/hadoop/security/token/delegation/AbstractDelegationTokenSecretManager.java
Thu Jun 23 23:55:30 2011
@@ -373,8 +373,7 @@ extends AbstractDelegationTokenIdentifie
               rollMasterKey();
               lastMasterKeyUpdate = now;
             } catch (IOException e) {
-              LOG.error("Master key updating failed. "
-                  + StringUtils.stringifyException(e));
+              LOG.error("Master key updating failed: ", e);
             }
           }
           if (lastTokenCacheCleanup + tokenRemoverScanInterval < now) {

Modified: hadoop/common/trunk/common/src/test/core/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/common/src/test/core/org/apache/hadoop/security/token/delegation/TestDelegationToken.java?rev=1139123&r1=1139122&r2=1139123&view=diff
==============================================================================
--- hadoop/common/trunk/common/src/test/core/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
(original)
+++ hadoop/common/trunk/common/src/test/core/org/apache/hadoop/security/token/delegation/TestDelegationToken.java
Thu Jun 23 23:55:30 2011
@@ -164,7 +164,7 @@ public class TestDelegationToken {
       action.run();
       Assert.fail("action did not throw " + except);
     } catch (Throwable th) {
-      LOG.info("Caught an exception: " + StringUtils.stringifyException(th));
+      LOG.info("Caught an exception: ", th);
       assertEquals("action threw wrong exception", except, th.getClass());
     }
   }



Mime
View raw message