You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2021/04/13 19:27:25 UTC

[GitHub] [accumulo] keith-turner commented on a change in pull request #1985: Move Constraints to API

keith-turner commented on a change in pull request #1985:
URL: https://github.com/apache/accumulo/pull/1985#discussion_r612717786



##########
File path: core/src/main/java/org/apache/accumulo/core/constraints/Constraint.java
##########
@@ -92,4 +84,16 @@
    * @return list of violation codes, or null if none
    */
   List<Short> check(Environment env, Mutation mutation);
+
+  /**
+   * For backwards compatibility. New API equivalent of {@link #check(Environment, Mutation)} but
+   * renamed to prevent ambiguous method call errors.
+   *
+   * @since 2.1.0
+   */
+  @Override
+  default List<Short> checkMutation(
+      org.apache.accumulo.core.data.constraints.Constraint.Environment env, Mutation mutation) {
+    throw new UnsupportedOperationException();
+  }

Review comment:
       I am not seeing where the tserver would ever call the older check() method for code implementing the older interface.  This method could do that serving as a bridge to code implementing the older interface.
   
   ```suggestion
     default List<Short> checkMutation(
         org.apache.accumulo.core.data.constraints.Constraint.Environment env, Mutation mutation) {
       return check(SomeClassNotInPublicAPI.convert(env), mutation);
     }
   ```




-- 
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org