keith-turner commented on code in PR #4852:
URL: https://github.com/apache/accumulo/pull/4852#discussion_r1742831338
##########
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:
This could be simplified by returning the StoredTabletFile object. Then the
caller can add it to the desired set.
```java
private static StoredTabletFile validateDataFileMetadata(ArrayList<Short>
violations, String metadata) {
try {
return StoredTabletFile.of(metadata);
} catch (RuntimeException e) {
addViolation(violations, 9);
}
}
```
--
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]