accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1470967 - in /accumulo/branches/1.5: core/src/main/java/org/apache/accumulo/core/conf/ server/src/main/java/org/apache/accumulo/server/master/recovery/
Date Tue, 23 Apr 2013 14:01:45 GMT
Author: ecn
Date: Tue Apr 23 14:01:45 2013
New Revision: 1470967

URL: http://svn.apache.org/r1470967
Log:
ACCUMULO-1328 make the retry time for recoverLease() configurable

Modified:
    accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/HadoopLogCloser.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
    accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/MapRLogCloser.java

Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java?rev=1470967&r1=1470966&r2=1470967&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java (original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/conf/Property.java Tue
Apr 23 14:01:45 2013
@@ -110,6 +110,8 @@ public enum Property {
   MASTER_THREADCHECK("master.server.threadcheck.time", "1s", PropertyType.TIMEDURATION, "The
time between adjustments of the server thread pool."),
   MASTER_RECOVERY_DELAY("master.recovery.delay", "10s", PropertyType.TIMEDURATION,
       "When a tablet server's lock is deleted, it takes time for it to completely quit. This
delay gives it time before log recoveries begin."),
+  MASTER_LEASE_RECOVERY_WAITING_PERIOD("master.lease.recovery.interval", "5s", PropertyType.TIMEDURATION,
+      "The amount of time to wait after requesting a WAL file to be recovered"),
   MASTER_WALOG_CLOSER_IMPLEMETATION("master.walog.closer.implementation", "org.apache.accumulo.server.master.recovery.HadoopLogCloser",
PropertyType.CLASSNAME,
       "A class that implements a mechansim to steal write access to a file"),
   MASTER_FATE_THREADPOOL_SIZE("master.fate.threadpool.size", "4", PropertyType.COUNT,

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/HadoopLogCloser.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/HadoopLogCloser.java?rev=1470967&r1=1470966&r2=1470967&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/HadoopLogCloser.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/HadoopLogCloser.java
Tue Apr 23 14:01:45 2013
@@ -19,6 +19,8 @@ package org.apache.accumulo.server.maste
 import java.io.FileNotFoundException;
 import java.io.IOException;
 
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.server.master.Master;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.LocalFileSystem;
 import org.apache.hadoop.fs.Path;
@@ -30,14 +32,14 @@ public class HadoopLogCloser implements 
   private static Logger log = Logger.getLogger(HadoopLogCloser.class);
 
   @Override
-  public long close(FileSystem fs, Path source) throws IOException {
+  public long close(Master master, FileSystem fs, Path source) throws IOException {
     
     if (fs instanceof DistributedFileSystem) {
       DistributedFileSystem dfs = (DistributedFileSystem) fs;
       try {
         if (!dfs.recoverLease(source)) {
           log.info("Waiting for file to be closed " + source.toString());
-          return 1000;
+          return master.getConfiguration().getConfiguration().getTimeInMillis(Property.MASTER_LEASE_RECOVERY_WAITING_PERIOD);
         }
         log.info("Recovered lease on " + source.toString());
         return 0;

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java?rev=1470967&r1=1470966&r2=1470967&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/LogCloser.java
Tue Apr 23 14:01:45 2013
@@ -18,9 +18,10 @@ package org.apache.accumulo.server.maste
 
 import java.io.IOException;
 
+import org.apache.accumulo.server.master.Master;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 
 public interface LogCloser {
-  public long close(FileSystem fs, Path path) throws IOException;
+  public long close(Master master, FileSystem fs, Path path) throws IOException;
 }

Modified: accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/MapRLogCloser.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/MapRLogCloser.java?rev=1470967&r1=1470966&r2=1470967&view=diff
==============================================================================
--- accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/MapRLogCloser.java
(original)
+++ accumulo/branches/1.5/server/src/main/java/org/apache/accumulo/server/master/recovery/MapRLogCloser.java
Tue Apr 23 14:01:45 2013
@@ -18,6 +18,7 @@ package org.apache.accumulo.server.maste
 
 import java.io.IOException;
 
+import org.apache.accumulo.server.master.Master;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
@@ -28,7 +29,7 @@ public class MapRLogCloser implements Lo
   private static Logger log = Logger.getLogger(MapRLogCloser.class);
   
   @Override
-  public long close(FileSystem fs, Path path) throws IOException {
+  public long close(Master m, FileSystem fs, Path path) throws IOException {
     log.info("Recovering file " + path.toString() + " by changing permission to readonly");
     FsPermission roPerm = new FsPermission((short) 0444);
     try {



Mime
View raw message