hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cdoug...@apache.org
Subject svn commit: r651691 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/ipc/RPC.java
Date Fri, 25 Apr 2008 19:58:22 GMT
Author: cdouglas
Date: Fri Apr 25 12:58:10 2008
New Revision: 651691

URL: http://svn.apache.org/viewvc?rev=651691&view=rev
Log:
HADOOP-3313. Avoid unnecessary calls to System.currentTimeMillis
in RPC::Invoker.


Modified:
    hadoop/core/trunk/CHANGES.txt
    hadoop/core/trunk/src/java/org/apache/hadoop/ipc/RPC.java

Modified: hadoop/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=651691&r1=651690&r2=651691&view=diff
==============================================================================
--- hadoop/core/trunk/CHANGES.txt (original)
+++ hadoop/core/trunk/CHANGES.txt Fri Apr 25 12:58:10 2008
@@ -88,6 +88,9 @@
     HADOOP-2793. Fix broken links for worst performing shuffle tasks in
     the job history page. (Amareshwari Sriramadasu via ddas)
 
+    HADOOP-3313. Avoid unnecessary calls to System.currentTimeMillis
+    in RPC::Invoker. (cdouglas)
+
 Release 0.17.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/core/trunk/src/java/org/apache/hadoop/ipc/RPC.java
URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/ipc/RPC.java?rev=651691&r1=651690&r2=651691&view=diff
==============================================================================
--- hadoop/core/trunk/src/java/org/apache/hadoop/ipc/RPC.java (original)
+++ hadoop/core/trunk/src/java/org/apache/hadoop/ipc/RPC.java Fri Apr 25 12:58:10 2008
@@ -208,11 +208,17 @@
 
     public Object invoke(Object proxy, Method method, Object[] args)
       throws Throwable {
-      long startTime = System.currentTimeMillis();
+      final boolean logDebug = LOG.isDebugEnabled();
+      long startTime = 0;
+      if (logDebug) {
+        startTime = System.currentTimeMillis();
+      }
       ObjectWritable value = (ObjectWritable)
         client.call(new Invocation(method, args), address, ticket);
-      long callTime = System.currentTimeMillis() - startTime;
-      LOG.debug("Call: " + method.getName() + " " + callTime);
+      if (logDebug) {
+        long callTime = System.currentTimeMillis() - startTime;
+        LOG.debug("Call: " + method.getName() + " " + callTime);
+      }
       return value.get();
     }
     



Mime
View raw message