accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [accumulo] 01/01: Merge branch '1.8'
Date Tue, 20 Feb 2018 17:12:41 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit 6be166caaba55d954a2f4fcc944ab29423a6a105
Merge: 6a2cbe9 155a713
Author: Keith Turner <kturner@apache.org>
AuthorDate: Tue Feb 20 12:12:25 2018 -0500

    Merge branch '1.8'

 .../accumulo/core/conf/AccumuloConfiguration.java  |  3 +-
 .../accumulo/server/conf/TableConfiguration.java   | 66 ++++++++++++++++++++++
 .../server/security/SecurityOperation.java         |  7 ++-
 .../accumulo/tserver/ConditionCheckerContext.java  | 16 +++---
 .../org/apache/accumulo/tserver/TabletServer.java  |  4 +-
 .../accumulo/tserver/TservConstraintEnv.java       |  2 +-
 .../accumulo/tserver/tablet/ScanDataSource.java    | 38 ++++++++++---
 .../accumulo/tserver/TservConstraintEnvTest.java   |  4 +-
 8 files changed, 115 insertions(+), 25 deletions(-)

diff --cc server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
index b9d92b7,e8798d0..da47f05
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
@@@ -16,10 -16,13 +16,16 @@@
   */
  package org.apache.accumulo.server.conf;
  
 +import static java.util.Objects.requireNonNull;
 +
+ import java.util.ArrayList;
+ import java.util.EnumMap;
+ import java.util.HashMap;
+ import java.util.List;
  import java.util.Map;
+ import java.util.Map.Entry;
+ import java.util.concurrent.atomic.AtomicReference;
 +import java.util.function.Predicate;
  
  import org.apache.accumulo.core.Constants;
  import org.apache.accumulo.core.client.Instance;
@@@ -34,6 -39,11 +43,10 @@@ import org.apache.accumulo.server.conf.
  import org.slf4j.Logger;
  import org.slf4j.LoggerFactory;
  
 -import com.google.common.base.Predicate;
+ import com.google.common.collect.ImmutableList;
+ import com.google.common.collect.ImmutableMap;
+ import com.google.common.collect.ImmutableMap.Builder;
+ 
  public class TableConfiguration extends ObservableConfiguration {
    private static final Logger log = LoggerFactory.getLogger(TableConfiguration.class);
  
@@@ -44,12 -54,19 +57,19 @@@
    private final NamespaceConfiguration parent;
    private ZooCacheFactory zcf = new ZooCacheFactory();
  
 -  private final String tableId;
 +  private final Table.ID tableId;
  
+   private EnumMap<IteratorScope,AtomicReference<ParsedIteratorConfig>> iteratorConfig;
+ 
 -  public TableConfiguration(Instance instance, String tableId, NamespaceConfiguration parent)
{
 -    this.instance = instance;
 -    this.tableId = tableId;
 -    this.parent = parent;
 +  public TableConfiguration(Instance instance, Table.ID tableId, NamespaceConfiguration
parent) {
 +    this.instance = requireNonNull(instance);
 +    this.tableId = requireNonNull(tableId);
 +    this.parent = requireNonNull(parent);
+ 
+     iteratorConfig = new EnumMap<>(IteratorScope.class);
+     for (IteratorScope scope : IteratorScope.values()) {
+       iteratorConfig.put(scope, new AtomicReference<ParsedIteratorConfig>(null));
+     }
    }
  
    void setZooCacheFactory(ZooCacheFactory zcf) {
diff --cc server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
index 327b084,ced6eed..053c35b
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
@@@ -189,14 -188,30 +191,36 @@@ class ScanDataSource implements DataSou
  
      if (!loadIters) {
        return visFilter;
-     } else if (null == options.getClassLoaderContext()) {
-       log.trace("Loading iterators for scan");
-       return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan,
visFilter, tablet.getExtent(), tablet.getTableConfiguration(),
-           options.getSsiList(), options.getSsio(), iterEnv));
      } else {
-       log.trace("Loading iterators for scan with scan context: {}", options.getClassLoaderContext());
-       return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan,
visFilter, tablet.getExtent(), tablet.getTableConfiguration(),
-           options.getSsiList(), options.getSsio(), iterEnv, true, options.getClassLoaderContext()));
+       List<IterInfo> iterInfos;
+       Map<String,Map<String,String>> iterOpts;
+ 
+       ParsedIteratorConfig pic = tablet.getTableConfiguration().getParsedIteratorConfig(IteratorScope.scan);
+       if (options.getSsiList().size() == 0 && options.getSsio().size() == 0) {
+         // No scan time iterator options were set, so can just use the pre-parsed table
iterator options.
+         iterInfos = pic.getIterInfo();
+         iterOpts = pic.getOpts();
+       } else {
+         // Scan time iterator options were set, so need to merge those with pre-parsed table
iterator options.
+         iterOpts = new HashMap<>(pic.getOpts().size() + options.getSsio().size());
+         iterInfos = new ArrayList<>(pic.getIterInfo().size() + options.getSsiList().size());
+         IteratorUtil.mergeIteratorConfig(iterInfos, iterOpts, pic.getIterInfo(), pic.getOpts(),
options.getSsiList(), options.getSsio());
+       }
+ 
+       String context;
+       if (options.getClassLoaderContext() != null) {
++        log.trace("Loading iterators for scan with scan context: {}", options.getClassLoaderContext());
+         context = options.getClassLoaderContext();
+       } else {
+         context = pic.getContext();
++        if (context != null) {
++          log.trace("Loading iterators for scan with table context: {}", options.getClassLoaderContext());
++        } else {
++          log.trace("Loading iterators for scan");
++        }
+       }
+ 
+       return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(visFilter, iterInfos,
iterOpts, iterEnv, true, context));
      }
    }
  

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

Mime
View raw message