You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by kt...@apache.org on 2013/03/11 21:26:03 UTC
svn commit: r1455313 - in /accumulo/branches/1.5:
core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
test/system/continuous/agitator.pl
Author: kturner
Date: Mon Mar 11 20:26:02 2013
New Revision: 1455313
URL: http://svn.apache.org/r1455313
Log:
ACCUMULO-1171 converted bulk import paths to fully qualified
Modified:
accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
accumulo/branches/1.5/test/system/continuous/agitator.pl
Modified: accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java?rev=1455313&r1=1455312&r2=1455313&view=diff
==============================================================================
--- accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java (original)
+++ accumulo/branches/1.5/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperationsImpl.java Mon Mar 11 20:26:02 2013
@@ -1050,8 +1050,9 @@ public class TableOperationsImpl extends
TableNotFoundException, AccumuloException {
ArgumentChecker.notNull(tableName, dir, failureDir);
FileSystem fs = FileUtil.getFileSystem(CachedConfiguration.getInstance(), instance.getConfiguration());
+ Path dirPath = fs.makeQualified(new Path(dir));
Path failPath = fs.makeQualified(new Path(failureDir));
- if (!fs.exists(new Path(dir)))
+ if (!fs.exists(dirPath))
throw new AccumuloException("Bulk import directory " + dir + " does not exist!");
if (!fs.exists(failPath))
throw new AccumuloException("Bulk import failure directory " + failureDir + " does not exist!");
@@ -1061,9 +1062,9 @@ public class TableOperationsImpl extends
throw new AccumuloException("Bulk import directory " + failPath + " is a file");
throw new AccumuloException("Bulk import failure directory " + failPath + " is not empty");
}
-
- List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(dir.getBytes()), ByteBuffer.wrap(failureDir.getBytes()),
- ByteBuffer.wrap((setTime + "").getBytes()));
+
+ List<ByteBuffer> args = Arrays.asList(ByteBuffer.wrap(tableName.getBytes()), ByteBuffer.wrap(dirPath.toString().getBytes()),
+ ByteBuffer.wrap(failPath.toString().getBytes()), ByteBuffer.wrap((setTime + "").getBytes()));
Map<String,String> opts = new HashMap<String,String>();
try {
Modified: accumulo/branches/1.5/test/system/continuous/agitator.pl
URL: http://svn.apache.org/viewvc/accumulo/branches/1.5/test/system/continuous/agitator.pl?rev=1455313&r1=1455312&r2=1455313&view=diff
==============================================================================
--- accumulo/branches/1.5/test/system/continuous/agitator.pl (original)
+++ accumulo/branches/1.5/test/system/continuous/agitator.pl Mon Mar 11 20:26:02 2013
@@ -18,8 +18,8 @@
use POSIX qw(strftime);
-if(scalar(@ARGV) != 4 && scalar(@ARGV) != 2){
- 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";
+if(scalar(@ARGV) != 4 && scalar(@ARGV) != 2 && scalar(@ARGV) != 5){
+ 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> [rand|exp]]\n";
exit(1);
}
@@ -52,9 +52,14 @@ if($sleep2 > $sleep2max){
die("sleep2 > sleep2max $sleep2 > $sleep2max");
}
-if(scalar(@ARGV) == 4){
+$mode = "rand";
+
+if(scalar(@ARGV) == 4 || scalar(@ARGV) == 5){
$minKill = $ARGV[2];
$maxKill = $ARGV[3];
+ if(scalar(@ARGV) == 5){
+ $mode = $ARGV[4];
+ }
}else{
$minKill = 1;
$maxKill = 1;
@@ -64,6 +69,10 @@ if($minKill > $maxKill){
die("minKill > maxKill $minKill > $maxKill");
}
+if($mode ne "rand" && $mode ne "exp"){
+ die("Mode was $mode, must be 'rand' or 'exp'");
+}
+
@slavesRaw = `cat $ACCUMULO_HOME/conf/slaves`;
chomp(@slavesRaw);
@@ -86,12 +95,32 @@ if ($minKill > $maxKill){
$minKill = $maxKill;
}
+$exp = 0;
+
while(1){
+ if($mode eq "exp"){
+ $numToKill = 2**$exp;
+ $exp++;
+ if($numToKill > $maxKill){
+ $exp = 0;
+ $numToKill = 2**$exp;
+ }
+
+ while($numToKill < $minKill){
+ $numToKill = 2**$exp;
+ $exp++;
+ }
- $numToKill = int(rand($maxKill - $minKill + 1)) + $minKill;
+ }else{
+ $numToKill = int(rand($maxKill - $minKill + 1)) + $minKill;
+ }
%killed = {};
+ print("Num to kill : $numToKill\n");
+ sleep(1);
+ next;
+
for($i = 0; $i < $numToKill; $i++){
$server = "";
while($server eq "" || $killed{$server} != undef){