You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nutch.apache.org by mc...@apache.org on 2005/08/24 18:28:39 UTC

svn commit: r239706 - /lucene/nutch/branches/mapred/src/java/org/apache/nutch/ndfs/NameNode.java

Author: mc
Date: Wed Aug 24 09:28:30 2005
New Revision: 239706

URL: http://svn.apache.org/viewcvs?rev=239706&view=rev
Log:

  Retry when block-obtain fails



Modified:
    lucene/nutch/branches/mapred/src/java/org/apache/nutch/ndfs/NameNode.java

Modified: lucene/nutch/branches/mapred/src/java/org/apache/nutch/ndfs/NameNode.java
URL: http://svn.apache.org/viewcvs/lucene/nutch/branches/mapred/src/java/org/apache/nutch/ndfs/NameNode.java?rev=239706&r1=239705&r2=239706&view=diff
==============================================================================
--- lucene/nutch/branches/mapred/src/java/org/apache/nutch/ndfs/NameNode.java (original)
+++ lucene/nutch/branches/mapred/src/java/org/apache/nutch/ndfs/NameNode.java Wed Aug 24 09:28:30 2005
@@ -106,13 +106,15 @@
     /**
      */
     public LocatedBlock addBlock(String src) throws IOException {
+        int retries = 5;
         Object results[] = namesystem.getAdditionalBlock(new UTF8(src));
-        if (results != null && results[0] == null) {
+        while (results != null && results[0] == null && retries > 0) {
             try {
-                Thread.sleep(50);
+                Thread.sleep(100);
             } catch (InterruptedException ie) {
             }
             results = namesystem.getAdditionalBlock(new UTF8(src));
+            retries--;
         }
 
         if (results == null) {