dlmarion commented on code in PR #5648:
URL: https://github.com/apache/accumulo/pull/5648#discussion_r2150103207


##########
core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletsMetadata.java:
##########
@@ -126,8 +131,19 @@ public TabletsMetadata build() {
           "scanTable() cannot be used in conjunction with forLevel(), 
forTable() or forTablet() %s %s",
           level, table);
       if (level == DataLevel.ROOT) {
-        ClientContext ctx = ((ClientContext) _client);
-        return new TabletsMetadata(getRootMetadata(ctx));
+        final ClientContext ctx = ((ClientContext) _client);
+        final RootTabletMetadata rtm = RootTabletMetadata.read(ctx);
+        final SortedMapIterator iter = new 
SortedMapIterator(rtm.toKeyValues());
+        if (!tabletMetadataFilters.isEmpty()) {
+          for (var filter : tabletMetadataFilters) {
+            if (!filter.acceptRow(iter)) {
+              LOG.trace("Not returning root metadata as it does not pass 
filter: {}",
+                  filter.getClass().getSimpleName());
+              return new TabletsMetadata((AutoCloseable) null, Set.of());
+            }
+          }
+        }
+        return new TabletsMetadata(rtm.toTabletMetadata());

Review Comment:
   > so we either return nothing or the RTM
   
   Yes, I think that's correct. If the code is using a filter, then it's 
looking for where a condition exists. So it's failing when the tablet metadata 
is returned and that condition does not exist.



-- 
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]

Reply via email to