milleruntime commented on a change in pull request #24: Update constraints example. Fixes #23 URL: https://github.com/apache/accumulo-examples/pull/24#discussion_r182831104
########## File path: docs/constraints.md ########## @@ -20,35 +20,27 @@ This tutorial uses the following Java classes, which can be found in org.apache. * AlphaNumKeyConstraint.java - a constraint that requires alphanumeric keys * NumericValueConstraint.java - a constraint that requires numeric string values + * MaxMutationSize.java - a constraint that limits the size of mutations accepted into a table + +Remember to copy the accumulo-examples-\*.jar to Accumulo's 'lib/ext' directory. + +The two examples below create table constraints for a key and value. The AlphaNumKeyConstraint will prevent +any keys from being created with characters that are not between aA and zZ or 0 to 9. The NumericValueConstraint will +prevent any values from being created with characters that are not between 0 and 9. The examples will attempt to create +key value pairs for the table that violate the constraint, throwing an exception. + + $ ./bin/runex constraints.AlphaNumKeyConstraint + $ ./bin/runex constraints.NumericValueConstraint + +The MaxMutationSize constraint will force the table to reject any mutation that is larger than 1/256th of the +working memory of the tablet server. The following example attempts to ingest a single row with a million columns, +which exceeds the memory limit. Depending on the amount of Java heap your tserver(s) are given, you may have to +increase the number of columns provided to see the failure. + + $ ./bin/runex constraints.MaxMutationSize + +[AlphaNumKeyConstraint.java]: ../src/main/java/org/apache/accumulo/examples/constraints/AlphaNumKeyConstraint.java Review comment: Forgot to actually use the links... whoops ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services