accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1335772 [2/2] - in /accumulo/trunk: ./ core/ core/src/main/java/org/apache/accumulo/core/util/shell/ core/src/main/java/org/apache/accumulo/core/util/shell/commands/ server/ server/src/main/java/org/apache/accumulo/server/logger/ src/ test...
Date Tue, 08 May 2012 21:14:40 GMT
Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java?rev=1335772&r1=1335771&r2=1335772&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java (original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/logger/LogReader.java Tue
May  8 21:14:39 2012
@@ -58,10 +58,10 @@ public class LogReader {
     Configuration conf = CachedConfiguration.getInstance();
     FileSystem fs = TraceFileSystem.wrap(FileUtil.getFileSystem(conf, ServerConfiguration.getSiteConfiguration()));
     FileSystem local = TraceFileSystem.wrap(FileSystem.getLocal(conf));
-    Option rowOpt = new Option("r", "--row", true, "search for a specific row");
-    Option maxOpt = new Option("m", "--max-mutations", true, "the maximum number of mutations
to print per log entry");
-    Option tabletOpt = new Option("t", "--tablet", true, "key extent");
-    Option rowPatternOpt = new Option("p", "--row-pattern", true, "search for a row that
matches the given regex");
+    Option rowOpt = new Option("r", "row", true, "search for a specific row");
+    Option maxOpt = new Option("m", "max-mutations", true, "the maximum number of mutations
to print per log entry");
+    Option tabletOpt = new Option("t", "tablet", true, "key extent");
+    Option rowPatternOpt = new Option("p", "row-pattern", true, "search for a row that matches
the given regex");
     Options options = new Options();
     options.addOption(rowOpt);
     options.addOption(maxOpt);

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1335106-1335108
  Merged /accumulo/branches/1.4/src/src:r1335106-1335108

Modified: accumulo/trunk/test/system/auto/simple/shell.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/shell.py?rev=1335772&r1=1335771&r2=1335772&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/shell.py (original)
+++ accumulo/trunk/test/system/auto/simple/shell.py Tue May  8 21:14:39 2012
@@ -63,7 +63,7 @@ class ShellTest(TestUtilsMixin,unittest.
         input = 'createtable setitertest\n'
         out,err,code = self.rootShell(self.masterHost(),input)
         self.processResult(out, err, code)
-        input = 'setiter -t setitertest -n mymax -scan -p 10 -class org.apache.accumulo.core.iterators.user.MaxCombiner\n\ncf1\n\nSTRING\n'
+        input = 'table setitertest\nsetiter -n mymax -scan -p 10 -class org.apache.accumulo.core.iterators.user.MaxCombiner\n\ncf1\n\nSTRING\n'
         out,err,code = self.rootShell(self.masterHost(),input)
         self.processResult(out, err, code)
         input = 'setiter -t setitertest -n mymax -scan -p 10 -class org.apache.accumulo.core.iterators.user.MinCombiner\n\ncf2\n\nSTRING\n'
@@ -97,11 +97,21 @@ class ShellTest(TestUtilsMixin,unittest.
         self.processResult(out, err, code)
         self.failIf(out.find("row cf:cq []    val1") == -1 or out.find("row cf:cq []    val2")
== -1,
                         "SetScanIter Failed:  versioning override failed")
+        input = 'table setscanitertest\nsetscaniter -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\nscan
-np\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        self.failIf(out.find("row cf:cq []    val1") == -1 or out.find("row cf:cq []    val2")
== -1,
+                        "SetScanIter Failed:  set on current table failed") 
         input = 'setscaniter -t setscanitertest -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\ndeletescaniter
-t setscanitertest -n vers\ntable setscanitertest\nscan -np\n'
         out,err,code = self.rootShell(self.masterHost(),input)
         self.processResult(out, err, code)
         self.failIf(out.find("row cf:cq []    val1") == 1 or out.find("row cf:cq []    val2")
== -1,
                         "SetScanIter Failed:  deletescaniter (single) failed")
+        input = 'table setscanitertest\nsetscaniter -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\ndeletescaniter
-n vers\ntable setscanitertest\nscan -np\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        self.failIf(out.find("row cf:cq []    val1") == 1 or out.find("row cf:cq []    val2")
== -1,
+                        "SetScanIter Failed:  deletescaniter on current table failed")
         input = 'setscaniter -t setscanitertest -n vers -p 20 -class org.apache.accumulo.core.iterators.user.VersioningIterator\n2\ndeletescaniter
-t setscanitertest -a\ntable setscanitertest\nscan -np\n'
         out,err,code = self.rootShell(self.masterHost(),input)
         self.processResult(out, err, code)
@@ -153,13 +163,28 @@ class ShellTest(TestUtilsMixin,unittest.
         input = 'deleteiter -t filtertest -n myfilter -scan\n'
         out,err,code = self.rootShell(self.masterHost(),input)
         self.processResult(out, err, code)
-        input = 'config -t filtertest -np\n'
+        input = 'config filtertest -np\n'
         out,err,code = self.rootShell(self.masterHost(),input)
         self.processResult(out, err, code)
         self.failUnless(out.find("table.iterator.scan.myfilter.opt.ttl") == -1, 
                         "Config Failed:  Iterator doesn't exist in the config")
-
-
+        input = 'table filtertest\nsetiter -n myfilter -scan -p 10 -class org.apache.accumulo.core.iterators.user.AgeOffFilter\n\n4000\n\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        input = 'config -t filtertest -np\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        self.failIf(out.find("table.iterator.scan.myfilter.opt.ttl") == -1,
+                        "Config Failed:  Iterator doesn't exist in the config")
+        input = 'table filtertest\ndeleteiter -n myfilter -scan\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        input = 'config filtertest -np\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        self.failUnless(out.find("table.iterator.scan.myfilter.opt.ttl") == -1,
+                        "Config Failed:  Iterator doesn't exist in the config")
+        
     def configTest(self):
         cf_option = "table.scan.max.memory"
         cf_value = "9361234"
@@ -280,14 +305,42 @@ class ShellTest(TestUtilsMixin,unittest.
         input = 'table !METADATA\nscan\n'
         out,err,code = self.rootShell(self.masterHost(),input)
         self.processResult(out, err, code)
-        count = 0
         testSplitsID = self.getTableId('test_splits')
         for a in out.split("\n"):
             if a.startswith(testSplitsID+';'):
                 split = a.split()[0].split(";",1)[1]
                 splits.remove(split)
-        self.failUnless(len(a) == 0, 
+        self.failUnless(len(splits) == 0, 
                         "CreateTable Failed:  Splits were not copied correctly")
+        input = 'createtable test_splits_2\naddsplits one\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        input = 'table !METADATA\nscan\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        splitTestID = self.getTableId('test_splits_2')
+        splits = []
+        for a in out.split("\n"):
+            if a.startswith(splitTestID+';'):
+                split = a.split()[0].split(";",1)[1]
+                splits.append(split)
+        log.debug(splits)
+        self.failUnless(len(splits) == 1*5 and splits[0] == 'one',
+                        "CreateTable Failed:  Splits were not created correctly (add one
split)")
+        input = 'createtable test_splits_3\naddsplits -sf %s\n' % splits_file 
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        input = 'table !METADATA\nscan\n'
+        out,err,code = self.rootShell(self.masterHost(),input)
+        self.processResult(out, err, code)
+        splitTestID = self.getTableId('test_splits_3')
+        splits = []
+        for a in out.split("\n"):
+            if a.startswith(splitTestID+';'):
+                split = a.split()[0].split(";",1)[1]
+                splits.append(split)
+        self.failUnless(len(splits) == 190*5,
+                        "CreateTable Failed:  Splits were not created correctly (addsplits
from file)")
     
     def deletetableTest(self):
         create = "createtable test_delete_table\n"
@@ -295,7 +348,7 @@ class ShellTest(TestUtilsMixin,unittest.
         self.processResult(out, err, code)
         self.failUnless(out.split("\n")[-1].find("test_table >"), 
                         "createtable command did not switch contexts to the new table")
-        delete = "deletetable test_delete_table\n"
+        delete = "deletetable -t test_delete_table\ny\n"
         out, err, code = self.rootShell(self.masterHost(), delete)
         self.processResult(out, err, code)
         input = "tables\n"
@@ -303,6 +356,23 @@ class ShellTest(TestUtilsMixin,unittest.
         self.processResult(out, err, code)
         self.failIf(out.find("test_delete_table") >= 0, 
                         "deletetable command did not delete the table" )
+        delete = "createtable test_delete_table1\ncreatetable test_delete_table2\ndeletetable
-p test_delete_table.* -f\n"
+        out, err, code = self.rootShell(self.masterHost(), delete)
+        self.processResult(out, err, code)
+        input = "tables\n"
+        out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
+        self.failIf(out.find("test_delete_table") >= 0,
+                        "deletetable -p command did not delete the tables" )
+        delete = "createtable test_delete_table\ndeletetable\ny\n"
+        out, err, code = self.rootShell(self.masterHost(), delete)
+        self.processResult(out, err, code)
+        input = "tables\n"
+        out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
+        self.failIf(out.find("test_delete_table") >= 0,
+                        "deletetable command did not delete the current table" )
+
         
     def scanTest(self):
         input = "createtable test_scan_table\n"
@@ -310,11 +380,36 @@ class ShellTest(TestUtilsMixin,unittest.
         self.processResult(out, err, code)
         input = "table test_scan_table\ninsert one two three four\nscan\n"
         out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
         self.failUnless(out.find("one") >= 0 and out.find("two") >= 0 and 
                         out.find("three") >= 0 and out.find("four") >= 0 and
                         out.find("one") < out.find("two") < 
                         out.find("three") < out.find("four"), 
                                     "scan command did not return the correct results")
+        input = "table test_scan_table\ndelete one two three\n"
+        out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
+        input = "table test_scan_table\nscan\n"
+        out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
+        self.failIf((out.find("one") >= 0) or (out.find("two") >= 0) or (out.find("three")
>= 0),
+                                    "scan command did not return the correct results")
+        input = "table test_scan_table\ninsert one two three four -ts 42\nscan\n"
+        out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
+        self.failUnless(out.find("one") >= 0 and out.find("two") >= 0 and
+                        out.find("three") >= 0 and out.find("four") >= 0 and
+                        out.find("one") < out.find("two") <
+                        out.find("three") < out.find("four"),
+                                    "scan command did not return the correct results")
+        input = "table test_scan_table\ndelete one two three -ts 42\n"
+        out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
+        input = "table test_scan_table\nscan\n"
+        out, err, code = self.rootShell(self.masterHost(), input)
+        self.processResult(out, err, code)
+        self.failIf(out.find("one") >= 0 or out.find("two") >= 0 or out.find("three")
>= 0,
+                                    "scan command did not return the correct results")
         
     def insertTest(self):
         input = "createtable test_insert_table\n"



Mime
View raw message