You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by vi...@apache.org on 2012/01/13 17:12:50 UTC

svn commit: r1231151 - in /incubator/accumulo/trunk: ./ src/core/ src/server/ src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java

Author: vines
Date: Fri Jan 13 16:12:50 2012
New Revision: 1231151

URL: http://svn.apache.org/viewvc?rev=1231151&view=rev
Log:
ACCUMULO-273 merging


Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/server/   (props changed)
    incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 13 16:12:50 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195,1230180,1230736,1231043
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1230701,1230706,1230753,1231044
+/incubator/accumulo/branches/1.4:1201902-1231149

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 13 16:12:50 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
-/incubator/accumulo/branches/1.4/src/core:1201902-1230701,1230706,1230753,1231044
+/incubator/accumulo/branches/1.4/src/core:1201902-1231149

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 13 16:12:50 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
 /incubator/accumulo/branches/1.3.5rc/src/server:1209938
-/incubator/accumulo/branches/1.4/src/server:1201902-1230701,1230706,1230753,1231044
+/incubator/accumulo/branches/1.4/src/server:1201902-1231149

Modified: incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java?rev=1231151&r1=1231150&r2=1231151&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java (original)
+++ incubator/accumulo/trunk/src/server/src/main/java/org/apache/accumulo/server/test/randomwalk/Module.java Fri Jan 13 16:12:50 2012
@@ -24,6 +24,7 @@ import java.util.Properties;
 import java.util.Random;
 import java.util.Set;
 import java.util.TreeSet;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import javax.xml.XMLConstants;
 import javax.xml.parsers.DocumentBuilder;
@@ -189,7 +190,16 @@ public class Module extends Node {
     }
     
     Node initNode = getNode(initNodeId);
+    
+    boolean test = false;
+    if (initNode instanceof Test) {
+      startTimer(initNode.toString());
+      test = true;
+    }
     initNode.visit(state, getProps(initNodeId));
+    if (test)
+      stopTimer(initNode.toString());
+
     state.visitedNode();
     // update aliases
     Set<String> aliases;
@@ -231,7 +241,14 @@ public class Module extends Node {
         nextNode = ((Alias) nextNode).get();
       }
       try {
+        test = false;
+        if (nextNode instanceof Test) {
+          startTimer(nextNode.toString());
+          test = true;
+        }
         nextNode.visit(state, getProps(nextNodeId));
+        if (test)
+          stopTimer(nextNode.toString());
       } catch (Exception e) {
         throw new Exception("Error running node " + nextNodeId, e);
       }
@@ -252,6 +269,53 @@ public class Module extends Node {
     }
   }
   
+  Thread timer = null;
+  final int time = 5 * 1000 * 60;
+  AtomicBoolean runningLong = new AtomicBoolean(false);
+  long systemTime;
+
+  /**
+   * 
+   */
+  private void startTimer(final String nodeName) {
+    runningLong.set(false);
+    timer = new Thread(new Runnable() {
+
+      @Override
+      public void run() {
+        try {
+          systemTime = System.currentTimeMillis();
+          synchronized (timer) {
+            timer.wait(time);
+          }
+        } catch (InterruptedException ie) {
+          return;
+        }
+        log.warn("Node " + nodeName + " has been running for " + time / 1000.0 + " seconds. You may want to look into it.");
+        runningLong.set(true);
+      }
+      
+    });
+    timer.start();
+  }
+  
+  /**
+   * 
+   */
+  private void stopTimer(String nodeName) {
+    synchronized (timer) {
+      timer.interrupt();
+      try {
+        timer.join();
+      } catch (InterruptedException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+      }
+    }
+    if (runningLong.get())
+      log.warn("Node " + nodeName + ", which was running long, has now completed after " + (System.currentTimeMillis() - systemTime) / 1000.0 + " seconds");
+  }
+
   @Override
   public String toString() {
     return xmlFile.toString();