blob: d6e50379f318c10d1e6ceb26698424debf5f4106 [file] [log] [blame]
<!--
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.
-->
<html>
<head>
<title>Accumulo Constraints</title>
<link rel='stylesheet' type='text/css' href='documentation.css' media='screen'/>
</head>
<body>
<h1>Apache Accumulo Documentation : Constraints</h1>
Accumulo supports constraints. Constraints are applied to mutations at ingest time.
<p>Implementing a new constraint is a snap. Simply write some Java code that
implements <code>org.apache.accumulo.core.constraints.Constraint</code>.
<p>To deploy a new constraint, jar it up and put the jar in accumulo/lib/ext.
<p>After creating a constraint, set a table specific property to use it. The following example adds two constraints to table foo. In the example com.test.ExampleConstraint and com.test.AnotherConstraint are class names.
<p><pre>
user@instance:9999 perDayCounts&gt; createtable foo
user@instance:9999 foo&gt; config -t foo -s table.constraint.1=com.test.ExampleConstraint
user@instance:9999 foo&gt; config -t foo -s table.constraint.2=com.test.AnotherConstraint
user@instance:9999 foo&gt; config -t foo -f constraint
---------+------------------------------------------+-----------------------------------------
SCOPE | NAME | VALUE
---------+------------------------------------------+-----------------------------------------
table | table.constraint.1...................... | com.test.ExampleConstraint
table | table.constraint.2...................... | com.test.AnotherConstraint
---------+------------------------------------------+-----------------------------------------
user@instance:9999 foo&gt;
</pre>
</body>
</html>