Author: ecn
Date: Tue Feb 19 17:39:58 2013
New Revision: 1447841
URL: http://svn.apache.org/r1447841
Log:
ACCUMULO-1053 move lease recovery check to isReady(), merge to new branch
Modified:
accumulo/branches/1.5/ (props changed)
accumulo/branches/1.5/assemble/ (props changed)
accumulo/branches/1.5/core/ (props changed)
accumulo/branches/1.5/examples/ (props changed)
accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
(props changed)
accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
(props changed)
accumulo/branches/1.5/server/ (props changed)
accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
accumulo/branches/1.5/src/ (props changed)
Propchange: accumulo/branches/1.5/
------------------------------------------------------------------------------
Merged /accumulo/trunk:r1447829
Propchange: accumulo/branches/1.5/assemble/
------------------------------------------------------------------------------
Merged /accumulo/trunk/assemble:r1447829
Propchange: accumulo/branches/1.5/core/
------------------------------------------------------------------------------
Merged /accumulo/trunk/core:r1447829
Propchange: accumulo/branches/1.5/examples/
------------------------------------------------------------------------------
Merged /accumulo/trunk/examples:r1447829
Propchange:
accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
Merged
/accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1447829
Propchange:
accumulo/branches/1.5/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java
------------------------------------------------------------------------------
Merged
/accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooSession.java:r1447829
Propchange: accumulo/branches/1.5/server/
------------------------------------------------------------------------------
Merged /accumulo/trunk/server:r1447829
Modified:
accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
URL:
http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java?rev=1447841&r1=1447840&r2=1447841&view=diff
==============================================================================
---
accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
(original)
+++
accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/RecoverLease.java
Tue Feb 19 17:39:58 2013
@@ -20,7 +20,6 @@ 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;
@@ -67,14 +66,14 @@ public class RecoverLease extends Master
if (diff <
master.getSystemConfiguration().getTimeInMillis(Property.MASTER_RECOVERY_DELAY))
return Math.max(diff, 0);
FileSystem fs = master.getFileSystem();
- if (fs.exists(getSource(master)))
- return 0;
+ if (fs.exists(getSource(master))) {
+ return recoverLease(master);
+ }
log.warn("Unable to locate file " + file + " wal for server " + server);
return 1000;
}
-
- @Override
- public Repo<Master> call(long tid, Master master) throws Exception {
+
+ private long recoverLease(Master master) {
Path source = getSource(master);
FileSystem fs = master.getFileSystem();
if (fs instanceof TraceFileSystem)
@@ -82,12 +81,12 @@ public class RecoverLease extends Master
try {
if (fs instanceof DistributedFileSystem) {
DistributedFileSystem dfs = (DistributedFileSystem) fs;
- while (!dfs.recoverLease(source)) {
+ if (!dfs.recoverLease(source)) {
log.info("Waiting for file to be closed " + source.toString());
- UtilWaitThread.sleep(1000);
+ return 1000;
}
log.info("Recovered lease on " + source.toString());
- return new SubmitFileForRecovery(server, file);
+ return 0;
}
} catch (IOException ex) {
log.error("error recovering lease ", ex);
@@ -95,13 +94,16 @@ public class RecoverLease extends Master
try {
fs.append(source).close();
log.info("Recovered lease on " + source.toString() + " using append");
- return new SubmitFileForRecovery(server, file);
+ return 0;
} catch (IOException ex) {
log.error("error recovering lease using append", ex);
- RecoverLease result = new RecoverLease();
- result.init(server, file);
- return result;
+ return 1000;
}
}
+
+ @Override
+ public Repo<Master> call(long tid, Master master) throws Exception {
+ return new SubmitFileForRecovery(server, file);
+ }
}
Propchange: accumulo/branches/1.5/src/
------------------------------------------------------------------------------
Merged /accumulo/trunk/src:r1447829