accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1447710 - /accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
Date Tue, 19 Feb 2013 13:25:43 GMT
Author: ecn
Date: Tue Feb 19 13:25:42 2013
New Revision: 1447710

URL: http://svn.apache.org/r1447710
Log:
ACCUMULO-1053 wait until a file has been closed before using it for recovery

Modified:
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java?rev=1447710&r1=1447709&r2=1447710&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
Tue Feb 19 13:25:42 2013
@@ -20,6 +20,7 @@ import java.io.IOException;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.util.UtilWaitThread;
 import org.apache.accumulo.fate.Repo;
 import org.apache.accumulo.server.master.Master;
 import org.apache.accumulo.server.master.tableOps.MasterRepo;
@@ -81,7 +82,10 @@ public class RecoverLease extends Master
     try {
       if (fs instanceof DistributedFileSystem) {
         DistributedFileSystem dfs = (DistributedFileSystem) fs;
-        dfs.recoverLease(source);
+        while (!dfs.recoverLease(source)) {
+          log.info("Waiting for file to be closed " + source.toString());
+          UtilWaitThread.sleep(1000);
+        }
         log.info("Recovered lease on " + source.toString());
         return new SubmitFileForRecovery(server, file);
       }



Mime
View raw message