kevinrr888 commented on code in PR #5519:
URL: https://github.com/apache/accumulo/pull/5519#discussion_r2068763280
##########
server/base/src/test/java/org/apache/accumulo/server/constraints/MetadataConstraintsTest.java:
##########
@@ -696,21 +696,10 @@ public void testAvailabilityColumn() {
Mutation m;
List<Short> violations;
- for (var sysTable : SystemTables.values()) {
- KeyExtent ke = new KeyExtent(sysTable.tableId(), null, null);
- m = new Mutation(ke.toMetaRow());
- TabletColumnFamily.AVAILABILITY_COLUMN.put(m, new
Value(TabletAvailability.UNHOSTED.name()));
- assertViolation(mc, m, (short) 4007);
- }
-
m = new Mutation(new Text("0;foo"));
TabletColumnFamily.AVAILABILITY_COLUMN.put(m, new Value("INVALID"));
assertViolation(mc, m, (short) 4005);
- m = new Mutation(new Text("foo"));
- TabletColumnFamily.AVAILABILITY_COLUMN.put(m, new
Value(TabletAvailability.UNHOSTED.name()));
- assertViolation(mc, m, (short) 4);
-
Review Comment:
Yeah could have left it, but isn't really testing the availability column
and is tested elsewhere. Was there before because I wanted to ensure that we
would never reach an IllegalArgumentException that could be thrown from
`KeyExtent.fromMetaRow(new Text(mutation.getRow()));` if the row was malformed,
causing violation 4005 to also be added, which would be incorrect
```
try {
TabletAvailabilityUtil.fromValue(new
Value(columnUpdate.getValue()));
if (!violations.contains((short) 4)) {
KeyExtent ke = KeyExtent.fromMetaRow(new
Text(mutation.getRow()));
if (ke.isSystemTable()) {
addViolation(violations, 4007);
}
}
} catch (IllegalArgumentException e) {
addViolation(violations, 4005);
}
```
--
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]