You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by bi...@apache.org on 2011/12/01 22:59:29 UTC

svn commit: r1209269 - in /incubator/accumulo/branches/1.4: src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/ test/system/auto/simple/

Author: billie
Date: Thu Dec  1 21:59:28 2011
New Revision: 1209269

URL: http://svn.apache.org/viewvc?rev=1209269&view=rev
Log:
ACCUMULO-148 created combiner functional test and shell warnings on using aggregators

Added:
    incubator/accumulo/branches/1.4/test/system/auto/simple/combiner.py   (with props)
Modified:
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
    incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java?rev=1209269&r1=1209268&r2=1209269&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/CreateTableCommand.java Thu Dec  1 21:59:28 2011
@@ -77,6 +77,7 @@ public class CreateTableCommand extends 
     boolean decode = cl.hasOption(base64Opt.getOpt());
     
     if (cl.hasOption(createTableOptAgg.getOpt())) {
+      Shell.log.warn("aggregators are deprecated");
       String agg = cl.getOptionValue(createTableOptAgg.getOpt());
       
       EscapeTokenizer st = new EscapeTokenizer(agg, "=,");
@@ -233,4 +234,4 @@ public class CreateTableCommand extends 
   public int numArgs() {
     return 1;
   }
-}
\ No newline at end of file
+}

Modified: incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java?rev=1209269&r1=1209268&r2=1209269&view=diff
==============================================================================
--- incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java (original)
+++ incubator/accumulo/branches/1.4/src/core/src/main/java/org/apache/accumulo/core/util/shell/commands/SetIterCommand.java Thu Dec  1 21:59:28 2011
@@ -76,6 +76,7 @@ public class SetIterCommand extends Comm
     Map<String,String> options = new HashMap<String,String>();
     String classname = cl.getOptionValue(classnameTypeOpt.getOpt());
     if (cl.hasOption(aggTypeOpt.getOpt())) {
+      Shell.log.warn("aggregators are deprecated");
       classname = AggregatingIterator.class.getName();
     } else if (cl.hasOption(regexTypeOpt.getOpt()))
       classname = RegExFilter.class.getName();
@@ -149,7 +150,7 @@ public class SetIterCommand extends Comm
     String shortClassName = className;
     if (className.contains("."))
       shortClassName = className.substring(className.lastIndexOf('.') + 1);
-
+    
     Map<String,String> localOptions = new HashMap<String,String>();
     do {
       // clean up the overall options that caused things to fail
@@ -235,7 +236,7 @@ public class SetIterCommand extends Comm
     aggTypeOpt = new Option("agg", "aggregator", false, "an aggregating type");
     regexTypeOpt = new Option("regex", "regular-expression", false, "a regex matching type");
     versionTypeOpt = new Option("vers", "version", false, "a versioning type");
-    nolabelTypeOpt = new Option("nolabel", "no-label", false, "a no-labeling type");
+    nolabelTypeOpt = new Option("nolabel", "no-label", false, "a blank visibility omitting type");
     ageoffTypeOpt = new Option("ageoff", "ageoff", false, "an aging off type");
     
     typeGroup.addOption(classnameTypeOpt);
@@ -260,4 +261,4 @@ public class SetIterCommand extends Comm
   public int numArgs() {
     return 0;
   }
-}
\ No newline at end of file
+}

Added: incubator/accumulo/branches/1.4/test/system/auto/simple/combiner.py
URL: http://svn.apache.org/viewvc/incubator/accumulo/branches/1.4/test/system/auto/simple/combiner.py?rev=1209269&view=auto
==============================================================================
--- incubator/accumulo/branches/1.4/test/system/auto/simple/combiner.py (added)
+++ incubator/accumulo/branches/1.4/test/system/auto/simple/combiner.py Thu Dec  1 21:59:28 2011
@@ -0,0 +1,66 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import os
+
+import logging
+import unittest
+import time
+
+from TestUtils import TestUtilsMixin
+
+log = logging.getLogger('test.auto')
+
+class CombinerTest(TestUtilsMixin, unittest.TestCase):
+    "Start a clean accumulo, use a Combiner, verify the data is aggregated"
+
+    order = 25
+
+    def checkSum(self):
+        # check the scan
+        out, err, code = self.shell(self.masterHost(),"table test\nscan\n")
+        self.assert_(code == 0)
+        for line in out.split('\n'):
+            if line.find('row1') == 0:
+                self.assert_(int(line.split()[-1]) == sum(range(10)))
+                break
+        else:
+            self.fail("Unable to find needed output in %r" % out)
+        
+    def runTest(self):
+
+        # initialize the database
+        out, err, code = self.rootShell(self.masterHost(),"createtable test\n"
+                     "setiter -t test -minc -majc -scan -p 10 -n mycombiner -class org.apache.accumulo.core.iterators.user.SummingCombiner\n"
+                     "cf\n"
+                     "STRING\n")
+        self.assert_(code == 0)
+
+        # insert some rows
+        log.info("Starting Test Ingester")
+        cmd = 'table test\n';
+        for i in range(10):
+            cmd += 'insert row1 cf col1 %d\n' % i
+        out, err, code = self.rootShell(self.masterHost(), cmd)
+        self.assert_(code == 0)
+        self.checkSum()
+        self.shutdown_accumulo()
+        self.start_accumulo()
+        self.checkSum()
+
+def suite():
+    result = unittest.TestSuite()
+    result.addTest(CombinerTest())
+    return result

Propchange: incubator/accumulo/branches/1.4/test/system/auto/simple/combiner.py
------------------------------------------------------------------------------
    svn:eol-style = native