keith-turner commented on code in PR #5490: URL: https://github.com/apache/accumulo/pull/5490#discussion_r2058552902
########## core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java: ########## @@ -74,8 +78,46 @@ class RFileScanner extends ScannerOptions implements Scanner { + private static class RFileScannerEnvironmentImpl extends ClientServiceEnvironmentImpl { + + private final Configuration conf; + private final Configuration tableConf; + + public RFileScannerEnvironmentImpl(Opts opts) { + super(null); + conf = new ConfigurationImpl(new ConfigurationCopy(DefaultConfiguration.getInstance())); + ConfigurationCopy tableCC = new ConfigurationCopy(DefaultConfiguration.getInstance()); + if (opts.tableConfig != null) { + opts.tableConfig.forEach(tableCC::set); + } + tableConf = new ConfigurationImpl(tableCC); + } + + @Override + public String getTableName(TableId tableId) throws TableNotFoundException { + Preconditions.checkArgument(tableId == TABLE_ID, "Expected " + TABLE_ID + " obtained" + + " from IteratorEnvironment.getTableId(), but got: " + tableId); + return TABLE_NAME; + } + + @Override + public Configuration getConfiguration() { + return conf; + } + + @Override + public Configuration getConfiguration(TableId tableId) { + Preconditions.checkArgument(tableId == TABLE_ID, "Expected " + TABLE_ID + " obtained" + + " from IteratorEnvironment.getTableId(), but got: " + tableId); + return tableConf; + } + + } + private static final byte[] EMPTY_BYTES = new byte[0]; private static final Range EMPTY_RANGE = new Range(); + private static final String TABLE_NAME = "rfileScanner"; + private static final TableId TABLE_ID = TableId.of(TABLE_NAME); Review Comment: Could spin this off in a separate issue since it was a preexisting pattern in the code. -- 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