made compact transient command retry when calling compact throws an exception 76/head
authorKeith Turner <kturner@apache.org>
Fri, 13 May 2016 19:28:26 +0000 (15:28 -0400)
committerKeith Turner <kturner@apache.org>
Fri, 13 May 2016 19:28:26 +0000 (15:28 -0400)
modules/accumulo/src/main/java/io/fluo/recipes/accumulo/cmds/CompactTransient.java

index 91e9164..91e90e7 100644 (file)
@@ -57,26 +57,27 @@ public class CompactTransient {
     @Override
     public void run() {
 
+      long t1 = System.currentTimeMillis();
+
       try {
-        long t1 = System.currentTimeMillis();
         TableOperations.compactTransient(fluoConfig, transientRange);
-        long t2 = System.currentTimeMillis();
-
-        long sleepTime = Math.max((long) (multiplier * (t2 - t1)), requestedSleepTime);
+      } catch (Exception e) {
+        log.warn("Compaction of " + transientRange + " failed ", e);
+      }
 
-        if (requestedSleepTime > 0) {
-          log.info("Compacted {} in {}ms sleeping {}ms", transientRange, t2 - t1, sleepTime);
-          schedExecutor.schedule(new CompactTask(transientRange, requestedSleepTime, multiplier),
-              sleepTime, TimeUnit.MILLISECONDS);
-        } else {
-          log.info("Compacted {} in {}ms", transientRange, t2 - t1);
-        }
+      long t2 = System.currentTimeMillis();
 
+      long sleepTime = Math.max((long) (multiplier * (t2 - t1)), requestedSleepTime);
 
-      } catch (Exception e) {
-        log.warn("Compaction of " + transientRange + " failed ", e);
+      if (requestedSleepTime > 0) {
+        log.info("Compacted {} in {}ms sleeping {}ms", transientRange, t2 - t1, sleepTime);
+        schedExecutor.schedule(new CompactTask(transientRange, requestedSleepTime, multiplier),
+            sleepTime, TimeUnit.MILLISECONDS);
+      } else {
+        log.info("Compacted {} in {}ms", transientRange, t2 - t1);
       }
 
+
     }