keith-turner commented on code in PR #5340:
URL: https://github.com/apache/accumulo/pull/5340#discussion_r1976053454
##########
core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java:
##########
@@ -558,6 +560,54 @@ private static Optional<TServerInstance>
checkServer(ClientContext context, Stri
.map(address -> new TServerInstance(address,
stat.getEphemeralOwner()));
}
+ public static void validate(TabletMetadata tm) {
+ if (!tm.fetchedCols.contains(ColumnType.FILES) || !tm.sawPrevEndRow) {
+ return;
+ }
+
+ Collection<StoredTabletFile> files = tm.getFiles();
+
+ Text prevEndRowText = tm.getPrevEndRow();
Review Comment:
We can simplify this code and use existing code that has lots of unit test
already by doing a few things.
Can get a data range for the tablet.
```java
Range tabletRange = tm.getExtent().toDataRange();
```
Then pass the tablet range to `isFileRangeValid()` function and inside the
function call `tabletRange.clip(fileRange,true)!=null` to check if a tablet and
file do overlap.
--
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]