ctubbsii commented on code in PR #5197:
URL: https://github.com/apache/accumulo/pull/5197#discussion_r2202094123
##########
core/src/main/java/org/apache/accumulo/core/clientImpl/bulk/LoadMappingIterator.java:
##########
@@ -72,12 +74,27 @@ public boolean hasNext() {
@Override
public Map.Entry<KeyExtent,Bulk.Files> next() {
- Bulk.Mapping bm = gson.fromJson(reader, Bulk.Mapping.class);
+ Bulk.Mapping bm;
+ try {
+ bm = gson.fromJson(reader, Bulk.Mapping.class);
+ } catch (JsonParseException e) {
+ throw new IllegalStateException("Failed to read next mapping", e);
+ }
+
+ KeyExtent currentKeyExtent = bm.getKeyExtent(tableId);
+
+ if (lastKeyExtent != null && currentKeyExtent.compareTo(lastKeyExtent) <
0) {
+ throw new IllegalStateException(
+ String.format("KeyExtents are not in sorted order: %s comes after
%s", lastKeyExtent,
Review Comment:
"comes after" is ambiguous. It's not clear if it's reporting what it saw or
what it is expecting. It could be interpreted as "should come after" or "came
after". It might be obvious from the keyextents themselves, but it would be
better to use language like:
* unexpectedly saw %s before/after %s
* %s occurred/was seen before %s
* %s must occur after/must follow %s
You can choose how you want to word it, but it should be clear from the word
choice what the order seen was, vs. the order expected.
--
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]