accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1332799 - in /accumulo/trunk: docs/examples/README.constraints docs/examples/README.maxmutation test/system/auto/simple/examples.py
Date Tue, 01 May 2012 19:54:48 GMT
Author: ecn
Date: Tue May  1 19:54:47 2012
New Revision: 1332799

URL: http://svn.apache.org/viewvc?rev=1332799&view=rev
Log:
ACCUMULO-283 document MaxMutationSize example

Added:
    accumulo/trunk/docs/examples/README.maxmutation
Modified:
    accumulo/trunk/docs/examples/README.constraints
    accumulo/trunk/test/system/auto/simple/examples.py

Modified: accumulo/trunk/docs/examples/README.constraints
URL: http://svn.apache.org/viewvc/accumulo/trunk/docs/examples/README.constraints?rev=1332799&r1=1332798&r2=1332799&view=diff
==============================================================================
--- accumulo/trunk/docs/examples/README.constraints (original)
+++ accumulo/trunk/docs/examples/README.constraints Tue May  1 19:54:47 2012
@@ -22,7 +22,7 @@ This tutorial uses the following Java cl
  * NumericValueConstraint.java - a constraint that requires numeric string values
 
 This an example of how to create a table with constraints. Below a table is
-create with two example constraints.  One constraints does not allow non alpha
+created with two example constraints.  One constraints does not allow non alpha
 numeric keys.  The other constraint does not allow non numeric values. Two
 inserts that violate these constraints are attempted and denied.  The scan at
 the end shows the inserts were not allowed. 
@@ -51,3 +51,4 @@ the end shows the inserts were not allow
     username@instance testConstraints> scan
     r1 cf1:cq1 []    1111
     username@instance testConstraints> 
+

Added: accumulo/trunk/docs/examples/README.maxmutation
URL: http://svn.apache.org/viewvc/accumulo/trunk/docs/examples/README.maxmutation?rev=1332799&view=auto
==============================================================================
--- accumulo/trunk/docs/examples/README.maxmutation (added)
+++ accumulo/trunk/docs/examples/README.maxmutation Tue May  1 19:54:47 2012
@@ -0,0 +1,47 @@
+Title: Apache Accumulo MaxMutation Constraints Example
+Notice:    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.
+
+This an example of how to limit the size of mutations that will be accepted into
+a table.  Under the default configuration, accumulo does not provide a limitation
+on the size of mutations that can be ingested.  Poorly behaved writers might
+inadvertently create mutations so large, that they cause the tablet servers
+or logger processes to run out of memory.  A simple contraint can be added to
+a table to reject very large mutations.
+
+    $ ./bin/accumulo shell -u username -p password
+    
+    Shell - Apache Accumulo Interactive Shell
+    - 
+    - version: 1.5.0-SNAPSHOT
+    - instance name: instance
+    - instance id: 00000000-0000-0000-0000-000000000000
+    - 
+    - type 'help' for a list of available commands
+    - 
+    username@instance> createtable test_ingest
+    username@instance test_ingest> config -t test_ingest -s table.constraint.1=org.apache.accumulo.examples.simple.constraints.MaxMutationSize
+    username@instance test_ingest> 
+
+
+Now the table will reject any mutation that is larger than 1/256th of the 
+working memory of the tablet server.  The following command attempts to ingest 
+a single row with 10000 columns, which exceeds the memory limit:
+
+    $ ./bin/accumulo org.apache.accumulo.server.test.TestIngest 1 0 10000
+ERROR : Constraint violates : ConstraintViolationSummary(constrainClass:org.apache.accumulo.examples.simple.constraints.MaxMutationSize,
violationCode:0, violationDescription:mutation exceeded maximum size of 188160, numberOfViolatingMutations:1)
+

Modified: accumulo/trunk/test/system/auto/simple/examples.py
URL: http://svn.apache.org/viewvc/accumulo/trunk/test/system/auto/simple/examples.py?rev=1332799&r1=1332798&r2=1332799&view=diff
==============================================================================
--- accumulo/trunk/test/system/auto/simple/examples.py (original)
+++ accumulo/trunk/test/system/auto/simple/examples.py Tue May  1 19:54:47 2012
@@ -41,7 +41,7 @@ class Examples(TestUtilsMixin, unittest.
     order = 21
 
     def runExample(self, cmd):
-        self.wait(self.runOn(self.masterHost(), [self.accumulo_sh(),] + cmd))
+        return self.wait(self.runOn(self.masterHost(), [self.accumulo_sh(),] + cmd))
 
     def ashell(self, input):
         out, err, code = self.shell(self.masterHost(), input + '\n')
@@ -58,9 +58,14 @@ class Examples(TestUtilsMixin, unittest.
         self.wait(self.runOn('localhost', cmd))
 
     def runTest(self):
-        self.ashell('createtable %s\nsetauths -u %s -s A,B\nquit\n' %(table, ROOT))
         examplesJar = glob.glob(ACCUMULO_HOME+'/lib/examples-simple*.jar')[0]
 
+	self.comment("Testing MaxMutation constraint")
+	self.ashell('createtable test_ingest\n'
+'config -t test_ingest -s table.constraint.1=org.apache.accumulo.examples.simple.constraints.MaxMutationSize\n')
+        self.assert_(not self.execute(self.accumulo_sh(), 'org.apache.accumulo.server.test.TestIngest',
'1', '0', '10000'))
+
+        self.ashell('createtable %s\nsetauths -u %s -s A,B\nquit\n' %(table, ROOT))
         self.comment("Testing dirlist example (a little)")
         self.comment("  ingesting accumulo source")
         self.execute(self.accumulo_sh(), 'org.apache.accumulo.examples.simple.dirlist.Ingest',



Mime
View raw message