You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by cu...@apache.org on 2006/09/07 00:39:39 UTC

svn commit: r440892 - in /lucene/hadoop/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/DFSClient.java

Author: cutting
Date: Wed Sep  6 15:39:38 2006
New Revision: 440892

URL: http://svn.apache.org/viewvc?view=rev&rev=440892
Log:
HADOOP-286.  Avoid pinging the NameNode with renewLease() calls when no files are being written.  Contributed by Konstantin.

Modified:
    lucene/hadoop/trunk/CHANGES.txt
    lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java

Modified: lucene/hadoop/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?view=diff&rev=440892&r1=440891&r2=440892
==============================================================================
--- lucene/hadoop/trunk/CHANGES.txt (original)
+++ lucene/hadoop/trunk/CHANGES.txt Wed Sep  6 15:39:38 2006
@@ -133,6 +133,10 @@
     the destination of a file copy is a directory.
     (Hairong Kuang via cutting)
 
+34. HADOOP-286.  In DFSClient, avoid pinging the NameNode with
+    renewLease() calls when no files are being written.
+    (Konstantin Shvachko via cutting)
+
 
 Release 0.5.0 - 2006-08-04
 

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java?view=diff&rev=440892&r1=440891&r2=440892
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/dfs/DFSClient.java Wed Sep  6 15:39:38 2006
@@ -436,8 +436,9 @@
             while (running) {
                 if (System.currentTimeMillis() - lastRenewed > (LEASE_PERIOD / 2)) {
                     try {
+                      if( pendingCreates.size() > 0 )
                         namenode.renewLease(clientName);
-                        lastRenewed = System.currentTimeMillis();
+                      lastRenewed = System.currentTimeMillis();
                     } catch (IOException ie) {
                       String err = StringUtils.stringifyException(ie);
                       LOG.warn("Problem renewing lease for " + clientName +