keith-turner commented on code in PR #4852:
URL: https://github.com/apache/accumulo/pull/4852#discussion_r1744608586


##########
server/base/src/main/java/org/apache/accumulo/server/constraints/MetadataConstraints.java:
##########
@@ -113,249 +112,111 @@ private static boolean isValidColumn(ColumnUpdate cu) {
     return validColumnQuals.contains(new ColumnFQ(cu));
   }
 
-  private static ArrayList<Short> addViolation(ArrayList<Short> lst, int 
violation) {
-    if (lst == null) {
-      lst = new ArrayList<>();
-    }
+  private static void addViolation(ArrayList<Short> lst, int violation) {
     lst.add((short) violation);
-    return lst;
   }
 
-  private static ArrayList<Short> addIfNotPresent(ArrayList<Short> lst, int 
intViolation) {
-    if (lst == null) {
-      return addViolation(null, intViolation);
-    }
-    short violation = (short) intViolation;
-    if (!lst.contains(violation)) {
-      return addViolation(lst, intViolation);
+  private static void addIfNotPresent(ArrayList<Short> lst, int violation) {
+    if (!lst.contains((short) violation)) {
+      addViolation(lst, violation);
     }
-    return lst;
   }
 
   /*
    * Validates the data file metadata is valid for a StoredTabletFile.
    */
-  private static ArrayList<Short> validateDataFileMetadata(ArrayList<Short> 
violations,
-      String metadata) {
+  private static void validateDataFileMetadata(ArrayList<Short> violations, 
String metadata,
+      BulkFileColData bfcValidationData, boolean addToDataFiles, boolean 
addToLoadedFiles) {

Review Comment:
   Should have mentioned this earlier.  With the consumer approach could pass 
method references like :
   
   ```java
       validateDataFileMetadata(violations, new 
String(columnUpdate.getColumnQualifier(), UTF_8),
           bfcValidationData::addDataFile);
   ```



-- 
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: notifications-unsubscr...@accumulo.apache.org

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

Reply via email to