accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmil...@apache.org
Subject [accumulo] branch master updated: Make RFileScanner use table props throughout (#493)
Date Tue, 22 May 2018 23:15:32 GMT
This is an automated email from the ASF dual-hosted git repository.

mmiller pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/master by this push:
     new efdd011  Make RFileScanner use table props throughout (#493)
efdd011 is described below

commit efdd0114298864d8411d74031d04ef93224c4c2c
Author: Mike Miller <mmiller@apache.org>
AuthorDate: Tue May 22 19:15:28 2018 -0400

    Make RFileScanner use table props throughout (#493)
---
 .../accumulo/core/client/rfile/RFileScanner.java   | 24 +++++++++++++---------
 1 file changed, 14 insertions(+), 10 deletions(-)

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 57bc144..6caaaf0 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.BaseIteratorEnvironment;
 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 @@ class RFileScanner extends ScannerOptions implements Scanner {
   private Opts opts;
   private int batchSize = 1000;
   private long readaheadThreshold = 3;
+  private AccumuloConfiguration tableConf;
 
   static class Opts {
     InputArgs in;
@@ -179,13 +181,17 @@ class RFileScanner extends ScannerOptions implements Scanner {
     }
 
     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 @@ class RFileScanner extends ScannerOptions implements Scanner {
       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 @@ class RFileScanner extends ScannerOptions implements Scanner {
 
       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,

-- 
To stop receiving notification emails like this one, please contact
mmiller@apache.org.

Mime
View raw message