milleruntime closed pull request #493: Make RFileScanner use table props throughout URL: https://github.com/apache/accumulo/pull/493
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java b/core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java index 57bc144bf1..6caaaf08a6 100644 --- a/core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java +++ b/core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java @@ -36,6 +36,7 @@ import org.apache.accumulo.core.client.impl.ScannerOptions; import org.apache.accumulo.core.client.rfile.RFileScannerBuilder.InputArgs; import org.apache.accumulo.core.client.sample.SamplerConfiguration; +import org.apache.accumulo.core.conf.AccumuloConfiguration; import org.apache.accumulo.core.conf.ConfigurationCopy; import org.apache.accumulo.core.conf.DefaultConfiguration; import org.apache.accumulo.core.conf.Property; @@ -78,6 +79,7 @@ private Opts opts; private int batchSize = 1000; private long readaheadThreshold = 3; + private AccumuloConfiguration tableConf; static class Opts { InputArgs in; @@ -179,13 +181,17 @@ public void indexWeightChanged() {} } this.opts = opts; + if (null != opts.tableConfig && opts.tableConfig.size() > 0) { + ConfigurationCopy tableCC = new ConfigurationCopy(DefaultConfiguration.getInstance()); + opts.tableConfig.forEach(tableCC::set); + this.tableConf = tableCC; + } else { + this.tableConf = DefaultConfiguration.getInstance(); + } if (opts.indexCacheSize > 0 || opts.dataCacheSize > 0) { - ConfigurationCopy cc = new ConfigurationCopy(DefaultConfiguration.getInstance()); - if (null != opts.tableConfig) { - opts.tableConfig.forEach(cc::set); - } - + ConfigurationCopy cc = tableConf instanceof ConfigurationCopy ? (ConfigurationCopy) tableConf + : new ConfigurationCopy(tableConf); try { blockCacheManager = BlockCacheManagerFactory.getClientInstance(cc); if (opts.indexCacheSize > 0) { @@ -347,9 +353,8 @@ public SamplerConfiguration getSamplerConfiguration() { for (int i = 0; i < sources.length; i++) { // TODO may have been a bug with multiple files and caching in older version... FSDataInputStream inputStream = (FSDataInputStream) sources[i].getInputStream(); - readers.add(new RFile.Reader( - new CachableBlockFile.Reader("source-" + i, inputStream, sources[i].getLength(), - opts.in.getConf(), dataCache, indexCache, DefaultConfiguration.getInstance()))); + readers.add(new RFile.Reader(new CachableBlockFile.Reader("source-" + i, inputStream, + sources[i].getLength(), opts.in.getConf(), dataCache, indexCache, tableConf))); } if (getSamplerConfiguration() != null) { @@ -377,8 +382,7 @@ public SamplerConfiguration getSamplerConfiguration() { try { if (opts.tableConfig != null && opts.tableConfig.size() > 0) { - ConfigurationCopy conf = new ConfigurationCopy(opts.tableConfig); - iterator = IteratorUtil.loadIterators(IteratorScope.scan, iterator, null, conf, + iterator = IteratorUtil.loadIterators(IteratorScope.scan, iterator, null, tableConf, serverSideIteratorList, serverSideIteratorOptions, new IterEnv()); } else { iterator = IteratorUtil.loadIterators(iterator, serverSideIteratorList, ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services