accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1450447 - in /accumulo/trunk: ./ test/system/continuous/agitator.pl
Date Tue, 26 Feb 2013 21:33:42 GMT
Author: vines
Date: Tue Feb 26 21:33:41 2013
New Revision: 1450447

URL: http://svn.apache.org/r1450447
Log:
ACCUMULO-338 - Committing Chris McCubbin's patch, with some updated usage information.



Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/test/system/continuous/agitator.pl

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.5:r1450419-1450440

Modified: accumulo/trunk/test/system/continuous/agitator.pl
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/continuous/agitator.pl?rev=1450447&r1=1450446&r2=1450447&view=diff
==============================================================================
--- accumulo/trunk/test/system/continuous/agitator.pl (original)
+++ accumulo/trunk/test/system/continuous/agitator.pl Tue Feb 26 21:33:41 2013
@@ -19,15 +19,38 @@
 use POSIX qw(strftime);
 
 if(scalar(@ARGV) != 4 && scalar(@ARGV) != 2){
-	print "Usage : agitator.pl <sleep before kill in minutes> <sleep before tup in
minutes> [<min kill> <max kill>]\n";
+	print "Usage : agitator.pl <min sleep before kill in minutes>[:max sleep before kill
in minutes] <min sleep before tup in minutes>[:max sleep before tup in minutes] [<min
kill> <max kill>]\n";
 	exit(1);
 }
 
 $ACCUMULO_HOME="../../..";
 $HADOOP_PREFIX=$ENV{"HADOOP_PREFIX"};
 
-$sleep1 = $ARGV[0];
-$sleep2 = $ARGV[1];
+@sleeprange1 = split(/:/, $ARGV[0]);
+$sleep1 = $sleeprange1[0];
+
+@sleeprange2 = split(/:/, $ARGV[1]);
+$sleep2 = $sleeprange2[0];
+
+if(scalar(@sleeprange1) > 1){
+    $sleep1max = $sleeprange1[1] + 1;
+}else{
+    $sleep1max = $sleep1;
+}
+
+if($sleep1 > $sleep1max){
+	die("sleep1 > sleep1max $sleep1 > $sleep1max");
+}
+
+if(scalar(@sleeprange2) > 1){
+    $sleep2max = $sleeprange2[1] + 1;
+}else{
+    $sleep2max = $sleep2;
+}
+
+if($sleep2 > $sleep2max){
+	die("sleep2 > sleep2max $sleep2 > $sleep2max");
+}
 
 if(scalar(@ARGV) == 4){
 	$minKill = $ARGV[2];
@@ -104,13 +127,15 @@ while(1){
 		}
 	}
 
-	sleep($sleep2 * 60);
+  $nextsleep2 = int(rand($sleep2max - $sleep2)) + $sleep2;
+	sleep($nextsleep2 * 60);
 	$t = strftime "%Y%m%d %H:%M:%S", localtime;
 	print STDERR "$t Running tup\n";
 	system("$ACCUMULO_HOME/bin/tup.sh");
 	print STDERR "$t Running start-dfs\n";
 	system("$HADOOP_PREFIX/bin/start-dfs.sh");
 
-	sleep($sleep1 * 60);
+  $nextsleep1 = int(rand($sleep1max - $sleep1)) + $sleep1;
+  sleep($nextsleep1 * 60);
 }
 



Mime
View raw message