kevinrr888 commented on code in PR #5490: URL: https://github.com/apache/accumulo/pull/5490#discussion_r2052762928
########## core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java: ########## @@ -292,15 +280,54 @@ public Iterator<Entry<Key,Value>> iterator() { EMPTY_BYTES, tableConf); } + ClientServiceEnvironmentImpl senv = new ClientServiceEnvironmentImpl(null) { + + @Override + public String getTableName(TableId tableId) throws TableNotFoundException { + throw new IllegalStateException("TableId not known in RFileScanner"); + } + + @Override + public <T> T instantiate(String className, Class<T> base) + throws ReflectiveOperationException, IOException { + return RFileScanner.class.getClassLoader().loadClass(className).asSubclass(base) + .getDeclaredConstructor().newInstance(); + } + + @Override + public <T> T instantiate(TableId tableId, String className, Class<T> base) + throws ReflectiveOperationException, IOException { + return instantiate(className, base); + } + + @Override + public Configuration getConfiguration() { + return new ConfigurationImpl(new ConfigurationCopy(DefaultConfiguration.getInstance())); + } + + @Override + public Configuration getConfiguration(TableId tableId) { + return new ConfigurationImpl(new ConfigurationCopy(opts.tableConfig)); + } + + }; + + ClientIteratorEnvironment.Builder iterEnvBuilder = + new RFileScannerIteratorEnvironmentBuilder().withEnvironment(senv) + .withAuthorizations(opts.auths).withScope(IteratorScope.scan); + if (getSamplerConfiguration() != null) { + iterEnvBuilder.withSamplerConfiguration(getSamplerConfiguration()); + } + IteratorEnvironment iterEnv = iterEnvBuilder.build(); Review Comment: I believe this needs a `withTableId`. While a table id doesn't make sense in this case, the use case would be: `env.getPluginEnv().getConfiguration(env.getTableId())` See discussions: https://github.com/apache/accumulo/issues/4810 and https://github.com/apache/accumulo/pull/4816/files#r1725159871 and https://github.com/apache/accumulo/pull/4816#issuecomment-2347164444 (2nd section) -- 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: notifications-unsubscr...@accumulo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org