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


##########
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:
   I added at IT in d421c0b, but two of the methods are not working as 
expected, and I'm not sure why. Specifically, the 
`testTabletsMetadataMetadataFilter` and `testTabletsMetadataUserFilter` are 
failing in that the first TabletsMetadata call in both methods is not returning 
data.



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