keith-turner commented on code in PR #6163:
URL: https://github.com/apache/accumulo/pull/6163#discussion_r2874537804
##########
core/src/main/java/org/apache/accumulo/core/data/constraints/DefaultKeySizeConstraint.java:
##########
@@ -44,21 +44,20 @@ public class DefaultKeySizeConstraint implements Constraint
{
@Override
public String getViolationDescription(short violationCode) {
- if (violationCode == MAX__KEY_SIZE_EXCEEDED_VIOLATION) {
- return "Key was larger than 1MB";
+ switch (violationCode) {
+ case MAX__KEY_SIZE_EXCEEDED_VIOLATION:
+ return "Key was larger than 1MB";
}
- return null;
+ return null;
}
- static final List<Short> NO_VIOLATIONS = new ArrayList<>();
-
@Override
public List<Short> check(Environment env, Mutation mutation) {
// fast size check
if (mutation.numBytes() < maxSize) {
- return NO_VIOLATIONS;
+ return null;
Review Comment:
Yeah, the javadoc for the super class says to return null when there are no
violations.
https://github.com/apache/accumulo/blob/d49e7cd46382336bbc88b187904cb05067b5bc44/core/src/main/java/org/apache/accumulo/core/data/constraints/Constraint.java#L90-L91
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]