public interface Constraint
This interface expects implementers to return violation codes. The reason codes are returned instead of arbitrary strings to encourage conciseness. Conciseness is needed because violations are aggregated. If a user sends a batch of 10,000 mutations to Accumulo, only aggregated counts about which violations occurred are returned. If the constraint implementer were allowed to return arbitrary violation strings like the following:
Value "abc" is not a number
Value "vbg" is not a number
This would not aggregate very well, because the same violation is represented with two different strings.
Modifier and Type | Interface and Description |
---|---|
static interface |
Constraint.Environment
The environment within which a constraint exists.
|
Modifier and Type | Method and Description |
---|---|
List<Short> |
check(Constraint.Environment env,
Mutation mutation)
Checks a mutation for constraint violations.
|
String |
getViolationDescription(short violationCode)
Gets a short, one-sentence description of what a given violation code means.
|
String getViolationDescription(short violationCode)
violationCode
- numeric violation codeList<Short> check(Constraint.Environment env, Mutation mutation)
env
- constraint environmentmutation
- mutation to checkCopyright © 2011–2019 The Apache Software Foundation. All rights reserved.