accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject svn commit: r1407902 - in /accumulo/trunk/test/system/bench: README lib/RowHashBenchmark.py lib/TeraSortBenchmark.py
Date Sat, 10 Nov 2012 23:49:05 GMT
Author: elserj
Date: Sat Nov 10 23:49:04 2012
New Revision: 1407902

URL: http://svn.apache.org/viewvc?rev=1407902&view=rev
Log:
ACCUMULO-827 Get all CloudStone tests running again
- Fix table code in CloudStone 7 and 8
- Fix options in README

Modified:
    accumulo/trunk/test/system/bench/README
    accumulo/trunk/test/system/bench/lib/RowHashBenchmark.py
    accumulo/trunk/test/system/bench/lib/TeraSortBenchmark.py

Modified: accumulo/trunk/test/system/bench/README
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/bench/README?rev=1407902&r1=1407901&r2=1407902&view=diff
==============================================================================
--- accumulo/trunk/test/system/bench/README (original)
+++ accumulo/trunk/test/system/bench/README Sat Nov 10 23:49:04 2012
@@ -8,8 +8,8 @@ Syntax for running run.py:
 Specifying a specific benchmark or set of benchmarks runs only those, while 
 not specifying any runs all benchmarks.
 -l Lists the benchmarks that will be run
--v <run_speed> can either be slow, medium or fast
--s <log_level> is a number representing the verbosity of the debugging output: 10 is
debug, 20 is info, 30 is warning, etc.
+-s <run_speed> can either be slow, medium or fast
+-v <log_level> is a number representing the verbosity of the debugging output: 10 is
debug, 20 is info, 30 is warning, etc.
 -u <user> user to use when connecting with accumulo.  If not set you will be prompted
to input it.
 -p <password> password to use when connecting with accumulo.  If not set you will be
prompted to input it.
 -i <instance> instance to use when connecting with accumulo.  If not set you will be
prompted to input it.

Modified: accumulo/trunk/test/system/bench/lib/RowHashBenchmark.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/bench/lib/RowHashBenchmark.py?rev=1407902&r1=1407901&r2=1407902&view=diff
==============================================================================
--- accumulo/trunk/test/system/bench/lib/RowHashBenchmark.py (original)
+++ accumulo/trunk/test/system/bench/lib/RowHashBenchmark.py Sat Nov 10 23:49:04 2012
@@ -42,23 +42,20 @@ class RowHashBenchmark(Benchmark):
     output_table = 'RowHashTestOutput'
 
     def setUp(self): 
-        random.jumpahead(int(time.time()))
-        num = random.randint(1, 100000)
-        self.input_table = self.input_table + "_" + str(num) 
-        self.output_table = self.output_table + "_" + str(num)    
         #if (not os.getenv("HADOOP_CLASSPATH")):
         #    os.putenv("HADOOP_CLASSPATH", self.getjars(":"))
         dir = os.path.dirname(os.path.realpath(__file__))
         file = os.path.join( dir, 'splits' )  
-        # code, out, err = cloudshell.run(self.username, self.password, 'table RowHashTestInput\n')

-        # if out.find('no such table') == -1:
-        #    code, out, err = cloudshell.run(self.username, self.password, 'deletetable RowHashTestInput\n')

-        #    self.sleep(15)
+        code, out, err = cloudshell.run(self.username, self.password, 'table %s\n' % self.input_table)

+        if out.find('does not exist') == -1:
+           code, out, err = cloudshell.run(self.username, self.password, 'deletetable -f
%s\n' % self.input_table) 
+           self.sleep(15)
         code, out, err = cloudshell.run(self.username, self.password, "createtable %s -sf
%s\n" % (self.input_table, file))
-        #code, out, err = cloudshell.run('table RowHashTest\n') 
-        #if out.find('no such table') == -1:
-        #    code, out, err = cloudshell.run('user root\nsecret\ndeletetable RowHashTest\n')

-        #    self.sleep(15)
+        code, out, err = cloudshell.run(self.username, self.password, 'table %s\n' % self.output_table)

+        if out.find('does not exist') == -1:
+            code, out, err = cloudshell.run(self.username, self.password, 'deletetable -f
%s\n' %
+                    self.output_table) 
+            self.sleep(15)
         code, out, err = cloudshell.run(self.username, self.password, "createtable %s -sf
%s\n" % (self.output_table, file))
         command = self.buildcommand('org.apache.accumulo.examples.simple.mapreduce.TeraSortIngest',
                                     self.numrows(),
@@ -77,6 +74,13 @@ class RowHashBenchmark(Benchmark):
         out, err = handle.communicate("")  
         Benchmark.setUp(self)
 
+    def tearDown(self):
+        code, out, err = cloudshell.run(self.username, self.password, "deletetable -f %s\n"
% self.input_table)
+        self.assertEqual(code, 0, 'Could not delete %s, %s' % (self.input_table, out))
+        code, out, err = cloudshell.run(self.username, self.password, "deletetable -f %s\n"
% self.output_table)
+        self.assertEqual(code, 0, 'Could not delete %s, %s' % (self.output_table, out))
+        Benchmark.tearDown(self)
+
     def keysizemin(self):
         return self.keymin
 
@@ -109,7 +113,7 @@ class RowHashBenchmark(Benchmark):
         return handle.returncode, out, err
     
     def shortDescription(self):
-        return 'Hashes %d rows from one tableand outputs them into another Table. '\
+        return 'Hashes %d rows from one table and outputs them into another table. '\
                'Lower score is better.' % (self.numrows())
                
     def setSpeed(self, speed):

Modified: accumulo/trunk/test/system/bench/lib/TeraSortBenchmark.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/bench/lib/TeraSortBenchmark.py?rev=1407902&r1=1407901&r2=1407902&view=diff
==============================================================================
--- accumulo/trunk/test/system/bench/lib/TeraSortBenchmark.py (original)
+++ accumulo/trunk/test/system/bench/lib/TeraSortBenchmark.py Sat Nov 10 23:49:04 2012
@@ -42,16 +42,16 @@ class TeraSortBenchmark(Benchmark):
 
 
     def setUp(self): 
-        random.jumpahead(int(time.time()))
-        num = random.randint(1, 100000)   
-        #self.tablename = self.tablename + "-" + str(num)  
-        # Find which hadoop version
-        # code, out, err = cloudshell.run(self.username, self.password, 'table %s\n' % self.tablename)
-        #if out.find('no such table') == -1:
-        #    log.debug('Deleting table %s' % self.tablename)
-        #    code, out, err = cloudshell.run(self.username, self.password, 'deletetable %s\n'
% self.tablename)
-        #    self.sleep(10)
+        code, out, err = cloudshell.run(self.username, self.password, 'table %s\n' % self.tablename)
+        if out.find('does not exist') == -1:
+            log.debug('Deleting table %s' % self.tablename)
+            code, out, err = cloudshell.run(self.username, self.password, 'deletetable -f
%s\n' % self.tablename)
         Benchmark.setUp(self)
+
+    def tearDown(self):
+        code, out, err = cloudshell.run(self.username, self.password, "deletetable -f %s\n"
% self.tablename)
+        self.assertEqual(code, 0, 'Could not delete %s, %s' % (self.tablename, out))
+        Benchmark.tearDown(self)
         
     def keysizemin(self):
         return self.keymin



Mime
View raw message