accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1241614 - in /incubator/accumulo/branches/1.4/src: core/src/main/java/org/apache/accumulo/core/zookeeper/ server/src/main/java/org/apache/accumulo/server/test/randomwalk/ server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk...
Date Tue, 07 Feb 2012 20:50:33 GMT
Author: ecn
Date: Tue Feb  7 20:50:32 2012
New Revision: 1241614

URL: http://svn.apache.org/viewvc?rev=1241614&view=rev
Log:
ACCUMULO-379: add the concept of "progress" to a node under test to suppress warnings about
stuck nodes; log Interrupted exceptions in the ZooCache at "INFO"

Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooCache.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Node.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/BatchScan.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/ScanTable.java
    incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooCache.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooCache.java?rev=1241614&r1=1241613&r2=1241614&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooCache.java
(original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/zookeeper/ZooCache.java
Tue Feb  7 20:50:32 2012
@@ -136,7 +136,7 @@ public class ZooCache {
         }
         log.warn("Zookeeper error, will retry", e);
       } catch (InterruptedException e) {
-        log.warn("Zookeeper error, will retry", e);
+        log.info("Zookeeper error, will retry", e);
       } catch (ConcurrentModificationException e) {
         log.debug("Zookeeper was modified, will retry");
       }

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java?rev=1241614&r1=1241613&r2=1241614&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java
Tue Feb  7 20:50:32 2012
@@ -194,12 +194,12 @@ public class Module extends Node {
     
     boolean test = false;
     if (initNode instanceof Test) {
-      startTimer(initNode.toString());
+      startTimer(initNode);
       test = true;
     }
     initNode.visit(state, getProps(initNodeId));
     if (test)
-      stopTimer(initNode.toString());
+      stopTimer(initNode);
 
     state.visitedNode();
     // update aliases
@@ -245,12 +245,12 @@ public class Module extends Node {
       try {
         test = false;
         if (nextNode instanceof Test) {
-          startTimer(nextNode.toString());
+          startTimer(nextNode);
           test = true;
         }
         nextNode.visit(state, nodeProps);
         if (test)
-          stopTimer(nextNode.toString());
+          stopTimer(nextNode);
       } catch (Exception e) {
         log.debug("Properties for node: " + nextNodeId);
         for (Entry<Object,Object> entry : nodeProps.entrySet()) {
@@ -283,32 +283,37 @@ public class Module extends Node {
   /**
    * 
    */
-  private void startTimer(final String nodeName) {
+  private void startTimer(final Node initNode) {
     runningLong.set(false);
     timer = new Thread(new Runnable() {
 
       @Override
       public void run() {
-        try {
-          systemTime = System.currentTimeMillis();
-          synchronized (timer) {
-            timer.wait(time);
+        while (!runningLong.get()) {
+          try {
+            systemTime = System.currentTimeMillis();
+            synchronized (timer) {
+              timer.wait(time);
+            }
+          } catch (InterruptedException ie) {
+            return;
           }
-        } catch (InterruptedException ie) {
-          return;
         }
-        log.warn("Node " + nodeName + " has been running for " + time / 1000.0 + " seconds.
You may want to look into it.");
+        long timeSinceLastProgress = System.currentTimeMillis() - initNode.lastProgress();
+        if (timeSinceLastProgress > time) {
+          log.warn("Node " + initNode + " has been running for " + timeSinceLastProgress
/ 1000.0 + " seconds. You may want to look into it.");
+        }
         runningLong.set(true);
       }
-      
     });
+    initNode.makingProgress();
     timer.start();
   }
   
   /**
    * 
    */
-  private void stopTimer(String nodeName) {
+  private void stopTimer(Node nextNode) {
     synchronized (timer) {
       timer.interrupt();
       try {
@@ -319,7 +324,7 @@ public class Module extends Node {
       }
     }
     if (runningLong.get())
-      log.warn("Node " + nodeName + ", which was running long, has now completed after "
+ (System.currentTimeMillis() - systemTime) / 1000.0 + " seconds");
+      log.warn("Node " + nextNode + ", which was running long, has now completed after "
+ (System.currentTimeMillis() - systemTime) / 1000.0 + " seconds");
   }
 
   @Override

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Node.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Node.java?rev=1241614&r1=1241613&r2=1241614&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Node.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Node.java
Tue Feb  7 20:50:32 2012
@@ -26,6 +26,7 @@ import org.apache.log4j.Logger;
 public abstract class Node {
   
   protected final Logger log = Logger.getLogger(this.getClass());
+  long progress = System.currentTimeMillis();
   
   /**
    * Visits node
@@ -45,4 +46,12 @@ public abstract class Node {
   public int hashCode() {
     return toString().hashCode();
   }
+  
+  synchronized public void makingProgress() {
+    progress = System.currentTimeMillis();
+  }
+  
+  synchronized public long lastProgress() {
+    return progress;
+  }
 }
\ No newline at end of file

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java?rev=1241614&r1=1241613&r2=1241614&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/bulk/Verify.java
Tue Feb  7 20:50:32 2012
@@ -45,8 +45,13 @@ public class Verify extends Test {
   public void visit(State state, Properties props) throws Exception {
     ThreadPoolExecutor threadPool = Setup.getThreadPool(state);
     threadPool.shutdown();
+    int lastSize = 0;
     while (!threadPool.isTerminated()) {
-      log.info("Waiting for " + (threadPool.getQueue().size() + threadPool.getActiveCount())
+ " nodes to complete");
+      int size = threadPool.getQueue().size() + threadPool.getActiveCount();
+      log.info("Waiting for " + size + " nodes to complete");
+      if (size != lastSize)
+        makingProgress();
+      lastSize = size;
       threadPool.awaitTermination(10, TimeUnit.SECONDS);
     }
     

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/BatchScan.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/BatchScan.java?rev=1241614&r1=1241613&r2=1241614&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/BatchScan.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/BatchScan.java
Tue Feb  7 20:50:32 2012
@@ -24,6 +24,7 @@ import java.util.Properties;
 import java.util.Random;
 
 import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.BatchScanner;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.TableDeletedException;
@@ -71,6 +72,12 @@ public class BatchScan extends Test {
       log.debug("BatchScan " + tableName + " failed, table deleted");
     } catch (TableOfflineException e) {
       log.debug("BatchScan " + tableName + " failed, offline");
+    } catch (RuntimeException e) {
+      if (e.getCause() instanceof AccumuloSecurityException) {
+        log.debug("BatchScan " + tableName + " failed, permission error");
+      } else {
+        throw e;
+      }
     }
   }
 }

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/ScanTable.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/ScanTable.java?rev=1241614&r1=1241613&r2=1241614&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/ScanTable.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/concurrent/ScanTable.java
Tue Feb  7 20:50:32 2012
@@ -23,6 +23,7 @@ import java.util.Properties;
 import java.util.Random;
 
 import org.apache.accumulo.core.Constants;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableDeletedException;
@@ -59,6 +60,12 @@ public class ScanTable extends Test {
       log.debug("Scan " + tableName + " failed, doesnt exist");
     } catch (TableOfflineException e) {
       log.debug("Scan " + tableName + " failed, offline");
+    } catch (RuntimeException e) {
+      if (e.getCause() instanceof AccumuloSecurityException) {
+        log.debug("BatchScan " + tableName + " failed, permission error");
+      } else {
+        throw e;
+      }
     }
   }
 }

Modified: incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java?rev=1241614&r1=1241613&r2=1241614&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java
(original)
+++ incubator/accumulo/branches/1.4/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java
Tue Feb  7 20:50:32 2012
@@ -17,8 +17,8 @@
 package org.apache.accumulo.server.test.randomwalk.shard;
 
 import java.util.Iterator;
-import java.util.Properties;
 import java.util.Map.Entry;
+import java.util.Properties;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Scanner;
@@ -54,6 +54,8 @@ public class VerifyIndex extends Test {
       if (key1.compareTo(key2, PartialKey.ROW_COLFAM_COLQUAL) != 0)
         throw new Exception("index rebuild mismatch " + key1 + " " + key2 + " " + indexTableName
+ " " + tmpIndexTableName);
       count++;
+      if (count % 1000 == 0)
+        makingProgress();
     }
     
     if (iter.hasNext())



Mime
View raw message