You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2021/04/15 23:07:23 UTC

[accumulo] branch main updated: Use builtin immutable maps/sets/lists when available (#2023)

This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/main by this push:
     new 30ce59f  Use builtin immutable maps/sets/lists when available (#2023)
30ce59f is described below

commit 30ce59fd94f51b60a30ced328156f02d3223330b
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu Apr 15 19:07:17 2021 -0400

    Use builtin immutable maps/sets/lists when available (#2023)
    
    Utilize some Java 11 features for immutable maps, sets, and lists, to
    minimize our dependence on equivalent Guava features. Some use of Guava
    builders for these are still used, since Java 11 doesn't have convenient
    immutable collection builders, but they have been made final to ensure
    we use them correctly and don't re-assign them once built.
---
 .../core/client/sample/RowColumnSampler.java       |  2 +-
 .../accumulo/core/client/sample/RowSampler.java    |  2 +-
 .../client/summary/SummarizerConfiguration.java    |  5 +-
 .../apache/accumulo/core/clientImpl/TableMap.java  |  4 +-
 .../accumulo/core/conf/AccumuloConfiguration.java  |  2 +-
 .../org/apache/accumulo/core/data/LoadPlan.java    |  2 +-
 .../core/metadata/schema/TabletMetadata.java       | 12 ++--
 .../core/spi/scan/HintScanPrioritizer.java         | 18 ++----
 .../core/spi/scan/SimpleScanDispatcher.java        | 42 +++++++-------
 .../accumulo/core/summary/SummarySerializer.java   |  2 +-
 .../accumulo/core/util/ConfigurationImpl.java      | 12 +---
 .../accumulo/core/util/LocalityGroupUtil.java      | 35 +++++-------
 .../iterators/FirstEntryInRowIteratorTest.java     |  4 +-
 .../core/iterators/system/MultiIteratorTest.java   |  6 +-
 .../core/iterators/user/LargeRowFilterTest.java    | 30 ++++------
 .../accumulo/server/conf/TableConfiguration.java   | 10 +---
 .../org/apache/accumulo/server/util/FileUtil.java  | 20 +++----
 .../java/org/apache/accumulo/manager/Manager.java  | 49 +++++++----------
 .../accumulo/manager/TabletGroupWatcher.java       | 20 +++----
 .../tableOps/bulkVer2/PrepBulkImportTest.java      |  2 +-
 .../org/apache/accumulo/tserver/OnlineTablets.java |  5 +-
 .../tserver/TabletServerResourceManager.java       | 34 +++---------
 .../org/apache/accumulo/tserver/tablet/Tablet.java | 13 ++---
 .../apache/accumulo/tserver/InMemoryMapTest.java   | 64 +++++++++++-----------
 .../java/org/apache/accumulo/shell/ShellUtil.java  | 17 +++---
 .../apache/accumulo/test/functional/SummaryIT.java | 12 ++--
 26 files changed, 175 insertions(+), 249 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/client/sample/RowColumnSampler.java b/core/src/main/java/org/apache/accumulo/core/client/sample/RowColumnSampler.java
index 1d71214..3199dc1 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/sample/RowColumnSampler.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/sample/RowColumnSampler.java
@@ -53,7 +53,7 @@ import org.apache.accumulo.core.data.Key;
  * <pre>
  * <code>
  * new SamplerConfiguration(RowColumnSampler.class.getName()).setOptions(
- *   ImmutableMap.of("hasher","murmur3_32","modulus","1009","qualifier","true"));
+ *   Map.of("hasher","murmur3_32","modulus","1009","qualifier","true"));
  * </code>
  * </pre>
  *
diff --git a/core/src/main/java/org/apache/accumulo/core/client/sample/RowSampler.java b/core/src/main/java/org/apache/accumulo/core/client/sample/RowSampler.java
index c80ce5c..d3a3a11 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/sample/RowSampler.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/sample/RowSampler.java
@@ -39,7 +39,7 @@ import org.apache.accumulo.core.data.Key;
  * <pre>
  * <code>
  * new SamplerConfiguration(RowSampler.class.getName()).setOptions(
- *   ImmutableMap.of("hasher","murmur3_32","modulus","1009"));
+ *   Map.of("hasher","murmur3_32","modulus","1009"));
  * </code>
  * </pre>
  *
diff --git a/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java b/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java
index 686932c..758891f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/summary/SummarizerConfiguration.java
@@ -182,13 +182,12 @@ public class SummarizerConfiguration {
    * @since 2.0.0
    */
   public static class Builder {
-    private String className;
-    private ImmutableMap.Builder<String,String> imBuilder;
+    private final String className;
+    private final ImmutableMap.Builder<String,String> imBuilder = ImmutableMap.builder();
     private String configId = null;
 
     private Builder(String className) {
       this.className = className;
-      this.imBuilder = ImmutableMap.builder();
     }
 
     /**
diff --git a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableMap.java b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableMap.java
index a273d3c..93fb618 100644
--- a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableMap.java
+++ b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableMap.java
@@ -55,8 +55,8 @@ public class TableMap {
 
     List<String> tableIds = zooCache.getChildren(context.getZooKeeperRoot() + Constants.ZTABLES);
     Map<NamespaceId,String> namespaceIdToNameMap = new HashMap<>();
-    var tableNameToIdBuilder = ImmutableMap.<String,TableId>builder();
-    var tableIdToNameBuilder = ImmutableMap.<TableId,String>builder();
+    final var tableNameToIdBuilder = ImmutableMap.<String,TableId>builder();
+    final var tableIdToNameBuilder = ImmutableMap.<TableId,String>builder();
 
     // use StringBuilder to construct zPath string efficiently across many tables
     StringBuilder zPathBuilder = new StringBuilder();
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
index 78cf45b..fafacf0 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
@@ -198,7 +198,7 @@ public abstract class AccumuloConfiguration implements Iterable<Entry<String,Str
   }
 
   public Map<String,String> getAllPropertiesWithPrefixStripped(Property prefix) {
-    var builder = ImmutableMap.<String,String>builder();
+    final var builder = ImmutableMap.<String,String>builder();
     getAllPropertiesWithPrefix(prefix).forEach((k, v) -> {
       String optKey = k.substring(prefix.getKey().length());
       builder.put(optKey, v);
diff --git a/core/src/main/java/org/apache/accumulo/core/data/LoadPlan.java b/core/src/main/java/org/apache/accumulo/core/data/LoadPlan.java
index 81514c0..9917ce0 100644
--- a/core/src/main/java/org/apache/accumulo/core/data/LoadPlan.java
+++ b/core/src/main/java/org/apache/accumulo/core/data/LoadPlan.java
@@ -197,7 +197,7 @@ public class LoadPlan {
 
   public static Builder builder() {
     return new Builder() {
-      ImmutableList.Builder<Destination> fmb = ImmutableList.builder();
+      final ImmutableList.Builder<Destination> fmb = ImmutableList.builder();
 
       @Override
       public Builder loadFileTo(String fileName, RangeType rangeType, Text startRow, Text endRow) {
diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java b/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
index a9e86ef..a7554fd 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/schema/TabletMetadata.java
@@ -298,14 +298,12 @@ public class TabletMetadata {
     Objects.requireNonNull(rowIter);
 
     TabletMetadata te = new TabletMetadata();
-    ImmutableSortedMap.Builder<Key,Value> kvBuilder = null;
-    if (buildKeyValueMap) {
-      kvBuilder = ImmutableSortedMap.naturalOrder();
-    }
+    final ImmutableSortedMap.Builder<Key,Value> kvBuilder =
+        buildKeyValueMap ? ImmutableSortedMap.naturalOrder() : null;
 
-    var filesBuilder = ImmutableMap.<StoredTabletFile,DataFileValue>builder();
-    var scansBuilder = ImmutableList.<StoredTabletFile>builder();
-    var logsBuilder = ImmutableList.<LogEntry>builder();
+    final var filesBuilder = ImmutableMap.<StoredTabletFile,DataFileValue>builder();
+    final var scansBuilder = ImmutableList.<StoredTabletFile>builder();
+    final var logsBuilder = ImmutableList.<LogEntry>builder();
     final var loadedFilesBuilder = ImmutableMap.<TabletFile,Long>builder();
     ByteSequence row = null;
 
diff --git a/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java b/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java
index 9ba67a9..5fa33b4 100644
--- a/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java
+++ b/core/src/main/java/org/apache/accumulo/core/spi/scan/HintScanPrioritizer.java
@@ -18,6 +18,8 @@
  */
 package org.apache.accumulo.core.spi.scan;
 
+import static java.util.stream.Collectors.toUnmodifiableMap;
+
 import java.util.Comparator;
 import java.util.Map;
 
@@ -25,8 +27,6 @@ import org.apache.accumulo.core.client.ScannerBase;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.ImmutableMap;
-
 /**
  * When configured for a scan executor, this prioritizer allows scanners to set priorities as
  * integers. Lower integers result in higher priority.
@@ -115,16 +115,10 @@ public class HintScanPrioritizer implements ScanPrioritizer {
     int defaultPriority = Integer
         .parseInt(params.getOptions().getOrDefault("default_priority", Integer.MAX_VALUE + ""));
 
-    var tpb = ImmutableMap.<String,Integer>builder();
-
-    params.getOptions().forEach((k, v) -> {
-      if (k.startsWith(PRIO_PREFIX)) {
-        String type = k.substring(PRIO_PREFIX.length());
-        tpb.put(type, Integer.parseInt(v));
-      }
-    });
-
-    Map<String,Integer> typePriorities = tpb.build();
+    Map<String,Integer> typePriorities =
+        params.getOptions().entrySet().stream().filter(e -> e.getKey().startsWith(PRIO_PREFIX))
+            .collect(toUnmodifiableMap(e -> e.getKey().substring(PRIO_PREFIX.length()),
+                e -> Integer.parseInt(e.getValue())));
 
     HintProblemAction hpa = HintProblemAction.valueOf(params.getOptions()
         .getOrDefault("bad_hint_action", HintProblemAction.LOG.name()).toUpperCase());
diff --git a/core/src/main/java/org/apache/accumulo/core/spi/scan/SimpleScanDispatcher.java b/core/src/main/java/org/apache/accumulo/core/spi/scan/SimpleScanDispatcher.java
index 29caeb3..4bba7d0 100644
--- a/core/src/main/java/org/apache/accumulo/core/spi/scan/SimpleScanDispatcher.java
+++ b/core/src/main/java/org/apache/accumulo/core/spi/scan/SimpleScanDispatcher.java
@@ -24,14 +24,14 @@ import java.util.HashSet;
 import java.util.Map;
 import java.util.Optional;
 import java.util.Set;
+import java.util.function.Function;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.util.stream.Collectors;
 
 import org.apache.accumulo.core.client.ScannerBase;
 import org.apache.accumulo.core.spi.scan.ScanDispatch.CacheUsage;
 
-import com.google.common.collect.ImmutableMap;
-
 /**
  * If no options are given, then this will default to an executor named {@code default} and
  * {@link CacheUsage#TABLE} for index and data cache. This dispatcher supports the following
@@ -118,27 +118,23 @@ public class SimpleScanDispatcher implements ScanDispatcher {
     multiDispatch = Optional.ofNullable(options.get("multi_executor"))
         .map(name -> ScanDispatch.builder().setExecutorName(name).build()).orElse(baseDispatch);
 
-    var stpb = ImmutableMap.<String,Map<ScanInfo.Type,ScanDispatch>>builder();
-
-    for (String hintScanType : hintScanTypes) {
-      EnumMap<ScanInfo.Type,ScanDispatch> precomupted = new EnumMap<>(ScanInfo.Type.class);
-
-      precomupted.put(ScanInfo.Type.SINGLE, ScanDispatch.builder()
-          .setExecutorName(
-              scanExecutors.getOrDefault(hintScanType, singleDispatch.getExecutorName()))
-          .setIndexCacheUsage(indexCacheUsage.getOrDefault(hintScanType, CacheUsage.TABLE))
-          .setDataCacheUsage(dataCacheUsage.getOrDefault(hintScanType, CacheUsage.TABLE)).build());
-
-      precomupted.put(ScanInfo.Type.MULTI, ScanDispatch.builder()
-          .setExecutorName(
-              scanExecutors.getOrDefault(hintScanType, multiDispatch.getExecutorName()))
-          .setIndexCacheUsage(indexCacheUsage.getOrDefault(hintScanType, CacheUsage.TABLE))
-          .setDataCacheUsage(dataCacheUsage.getOrDefault(hintScanType, CacheUsage.TABLE)).build());
-
-      stpb.put(hintScanType, precomupted);
-    }
-
-    hintDispatch = stpb.build();
+    hintDispatch = hintScanTypes.stream()
+        .collect(Collectors.toUnmodifiableMap(Function.identity(), hintScanType -> {
+          EnumMap<ScanInfo.Type,ScanDispatch> precomupted = new EnumMap<>(ScanInfo.Type.class);
+          CacheUsage iCacheUsage = indexCacheUsage.getOrDefault(hintScanType, CacheUsage.TABLE);
+          CacheUsage dCacheUsage = dataCacheUsage.getOrDefault(hintScanType, CacheUsage.TABLE);
+          precomupted.put(ScanInfo.Type.SINGLE,
+              ScanDispatch.builder()
+                  .setExecutorName(
+                      scanExecutors.getOrDefault(hintScanType, singleDispatch.getExecutorName()))
+                  .setIndexCacheUsage(iCacheUsage).setDataCacheUsage(dCacheUsage).build());
+          precomupted.put(ScanInfo.Type.MULTI,
+              ScanDispatch.builder()
+                  .setExecutorName(
+                      scanExecutors.getOrDefault(hintScanType, multiDispatch.getExecutorName()))
+                  .setIndexCacheUsage(iCacheUsage).setDataCacheUsage(dCacheUsage).build());
+          return precomupted;
+        }));
   }
 
   @Override
diff --git a/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java b/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java
index d5fd212..4364a9b 100644
--- a/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java
+++ b/core/src/main/java/org/apache/accumulo/core/summary/SummarySerializer.java
@@ -537,7 +537,7 @@ class SummarySerializer {
 
   private static Map<String,Long> readSummary(DataInputStream in, String[] symbols)
       throws IOException {
-    var imb = ImmutableMap.<String,Long>builder();
+    final var imb = ImmutableMap.<String,Long>builder();
     int numEntries = WritableUtils.readVInt(in);
 
     for (int i = 0; i < numEntries; i++) {
diff --git a/core/src/main/java/org/apache/accumulo/core/util/ConfigurationImpl.java b/core/src/main/java/org/apache/accumulo/core/util/ConfigurationImpl.java
index 0009c86..87d34ac 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/ConfigurationImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/ConfigurationImpl.java
@@ -32,8 +32,6 @@ import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.conf.PropertyType;
 import org.apache.accumulo.core.spi.common.ServiceEnvironment.Configuration;
 
-import com.google.common.collect.ImmutableMap;
-
 public class ConfigurationImpl implements Configuration {
 
   private final AccumuloConfiguration acfg;
@@ -110,13 +108,9 @@ public class ConfigurationImpl implements Configuration {
 
   private Map<String,String> buildCustom(Property customPrefix) {
     // This could be optimized as described in #947
-    Map<String,String> props = acfg.getAllPropertiesWithPrefix(customPrefix);
-    var builder = ImmutableMap.<String,String>builder();
-    props.forEach((k, v) -> {
-      builder.put(k.substring(customPrefix.getKey().length()), v);
-    });
-
-    return builder.build();
+    return acfg.getAllPropertiesWithPrefix(customPrefix).entrySet().stream().collect(
+        Collectors.toUnmodifiableMap(e -> e.getKey().substring(customPrefix.getKey().length()),
+            Entry::getValue));
   }
 
   @Override
diff --git a/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java b/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
index a0f23db..be6b608 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/LocalityGroupUtil.java
@@ -18,6 +18,8 @@
  */
 package org.apache.accumulo.core.util;
 
+import static java.util.stream.Collectors.toUnmodifiableSet;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -51,18 +53,14 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableSet;
 
 public class LocalityGroupUtil {
 
   private static final Logger log = LoggerFactory.getLogger(LocalityGroupUtil.class);
 
-  // using an ImmutableSet here for more efficient comparisons in LocalityGroupIterator
-  public static final Set<ByteSequence> EMPTY_CF_SET = Set.of();
-
   /**
    * Create a set of families to be passed into the SortedKeyValueIterator seek call from a supplied
-   * set of columns. We are using the ImmutableSet to enable faster comparisons down in the
+   * set of columns. We are using the immutable set to enable faster comparisons down in the
    * LocalityGroupIterator.
    *
    * @param columns
@@ -71,11 +69,10 @@ public class LocalityGroupUtil {
    */
   public static Set<ByteSequence> families(Collection<Column> columns) {
     if (columns.isEmpty()) {
-      return EMPTY_CF_SET;
+      return Set.of();
     }
-    var builder = ImmutableSet.<ByteSequence>builder();
-    columns.forEach(c -> builder.add(new ArrayByteSequence(c.getColumnFamily())));
-    return builder.build();
+    return columns.stream().map(c -> new ArrayByteSequence(c.getColumnFamily()))
+        .collect(toUnmodifiableSet());
   }
 
   @SuppressWarnings("serial")
@@ -129,18 +126,16 @@ public class LocalityGroupUtil {
         String group = property.substring(prefix.length());
         String[] parts = group.split("\\.");
         group = parts[0];
-        if (result.containsKey(group)) {
-          if (parts.length == 1) {
-            Set<ByteSequence> colFamsSet = decodeColumnFamilies(value);
-            if (!Collections.disjoint(all, colFamsSet)) {
-              colFamsSet.retainAll(all);
-              throw new LocalityGroupConfigurationError("Column families " + colFamsSet
-                  + " in group " + group + " is already used by another locality group");
-            }
-
-            all.addAll(colFamsSet);
-            result.put(group, colFamsSet);
+        if (result.containsKey(group) && (parts.length == 1)) {
+          Set<ByteSequence> colFamsSet = decodeColumnFamilies(value);
+          if (!Collections.disjoint(all, colFamsSet)) {
+            colFamsSet.retainAll(all);
+            throw new LocalityGroupConfigurationError("Column families " + colFamsSet + " in group "
+                + group + " is already used by another locality group");
           }
+
+          all.addAll(colFamsSet);
+          result.put(group, colFamsSet);
         }
       }
     }
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowIteratorTest.java
index c93c8b8..8e7d8cc 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/FirstEntryInRowIteratorTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.io.IOException;
+import java.util.Set;
 import java.util.TreeMap;
 
 import org.apache.accumulo.core.client.IteratorSetting;
@@ -30,7 +31,6 @@ import org.apache.accumulo.core.data.PartialKey;
 import org.apache.accumulo.core.data.Range;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iteratorsImpl.system.CountingIterator;
-import org.apache.accumulo.core.util.LocalityGroupUtil;
 import org.junit.Test;
 
 public class FirstEntryInRowIteratorTest {
@@ -44,7 +44,7 @@ public class FirstEntryInRowIteratorTest {
 
     feiri.init(counter, iteratorSetting.getOptions(), env);
 
-    feiri.seek(range, LocalityGroupUtil.EMPTY_CF_SET, false);
+    feiri.seek(range, Set.of(), false);
     while (feiri.hasTop()) {
       resultMap.put(feiri.getTopKey(), feiri.getTopValue());
       feiri.next();
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/system/MultiIteratorTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/system/MultiIteratorTest.java
index 74860b3..500eee0 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/system/MultiIteratorTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/system/MultiIteratorTest.java
@@ -26,6 +26,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 import java.util.TreeMap;
 
 import org.apache.accumulo.core.data.ByteSequence;
@@ -37,7 +38,6 @@ import org.apache.accumulo.core.dataImpl.KeyExtent;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iteratorsImpl.system.MultiIterator;
-import org.apache.accumulo.core.util.LocalityGroupUtil;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
@@ -79,11 +79,11 @@ public class MultiIteratorTest {
       Range range = new Range(prevEndRow, false, endRow, true);
       if (init)
         for (SortedKeyValueIterator<Key,Value> iter : iters)
-          iter.seek(range, LocalityGroupUtil.EMPTY_CF_SET, false);
+          iter.seek(range, Set.of(), false);
       mi = new MultiIterator(iters, range);
 
       if (init)
-        mi.seek(range, LocalityGroupUtil.EMPTY_CF_SET, false);
+        mi.seek(range, Set.of(), false);
     }
 
     if (seekKey != null)
diff --git a/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java b/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
index 4516afc..d76dffd 100644
--- a/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/iterators/user/LargeRowFilterTest.java
@@ -23,6 +23,7 @@ import static org.junit.Assert.assertFalse;
 
 import java.io.IOException;
 import java.util.HashSet;
+import java.util.Set;
 import java.util.TreeMap;
 
 import org.apache.accumulo.core.client.IteratorSetting;
@@ -35,7 +36,6 @@ import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.IteratorUtil.IteratorScope;
 import org.apache.accumulo.core.iterators.SortedMapIterator;
 import org.apache.accumulo.core.iteratorsImpl.system.ColumnFamilySkippingIterator;
-import org.apache.accumulo.core.util.LocalityGroupUtil;
 import org.junit.Test;
 
 public class LargeRowFilterTest {
@@ -82,7 +82,7 @@ public class LargeRowFilterTest {
       genTestData(expectedData, i);
 
       LargeRowFilter lrfi = setupIterator(testData, i, IteratorScope.scan);
-      lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+      lrfi.seek(new Range(), Set.of(), false);
 
       TreeMap<Key,Value> filteredData = new TreeMap<>();
 
@@ -111,7 +111,7 @@ public class LargeRowFilterTest {
 
       // seek to each row... rows that exceed max columns should be filtered
       for (int j = 1; j <= i; j++) {
-        lrfi.seek(new Range(genRow(j), genRow(j)), LocalityGroupUtil.EMPTY_CF_SET, false);
+        lrfi.seek(new Range(genRow(j), genRow(j)), Set.of(), false);
 
         while (lrfi.hasTop()) {
           assertEquals(genRow(j), lrfi.getTopKey().getRow().toString());
@@ -133,16 +133,12 @@ public class LargeRowFilterTest {
     LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.scan);
 
     // test seeking to the middle of a row
-    lrfi.seek(
-        new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true,
-            new Key(genRow(15)).followingKey(PartialKey.ROW), false),
-        LocalityGroupUtil.EMPTY_CF_SET, false);
+    lrfi.seek(new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true,
+        new Key(genRow(15)).followingKey(PartialKey.ROW), false), Set.of(), false);
     assertFalse(lrfi.hasTop());
 
-    lrfi.seek(
-        new Range(new Key(genRow(10), "cf001", genCQ(4), 5), true,
-            new Key(genRow(10)).followingKey(PartialKey.ROW), false),
-        LocalityGroupUtil.EMPTY_CF_SET, false);
+    lrfi.seek(new Range(new Key(genRow(10), "cf001", genCQ(4), 5), true,
+        new Key(genRow(10)).followingKey(PartialKey.ROW), false), Set.of(), false);
     TreeMap<Key,Value> expectedData = new TreeMap<>();
     genRow(expectedData, 10, 4, 10);
 
@@ -162,7 +158,7 @@ public class LargeRowFilterTest {
     genTestData(testData, 20);
 
     LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.majc);
-    lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    lrfi.seek(new Range(), Set.of(), false);
 
     TreeMap<Key,Value> compactedData = new TreeMap<>();
     while (lrfi.hasTop()) {
@@ -178,7 +174,7 @@ public class LargeRowFilterTest {
     // because there are suppression markers.. if there was a bug and data
     // was not suppressed, increasing the threshold would expose the bug
     lrfi = setupIterator(compactedData, 20, IteratorScope.scan);
-    lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    lrfi.seek(new Range(), Set.of(), false);
 
     // only expect to see 13 rows
     TreeMap<Key,Value> expectedData = new TreeMap<>();
@@ -195,10 +191,8 @@ public class LargeRowFilterTest {
 
     // try seeking to the middle of row 15... row has data and suppression marker... this seeks past
     // the marker but before the column
-    lrfi.seek(
-        new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true,
-            new Key(genRow(15)).followingKey(PartialKey.ROW), false),
-        LocalityGroupUtil.EMPTY_CF_SET, false);
+    lrfi.seek(new Range(new Key(genRow(15), "cf001", genCQ(4), 5), true,
+        new Key(genRow(15)).followingKey(PartialKey.ROW), false), Set.of(), false);
     assertFalse(lrfi.hasTop());
 
     // test seeking w/ column families
@@ -224,7 +218,7 @@ public class LargeRowFilterTest {
     genRow(expectedData, 4, 0, 5);
 
     LargeRowFilter lrfi = setupIterator(testData, 13, IteratorScope.scan);
-    lrfi.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    lrfi.seek(new Range(), Set.of(), false);
 
     TreeMap<Key,Value> filteredData = new TreeMap<>();
     while (lrfi.hasTop()) {
diff --git 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
index 8e24224..87045ea 100644
--- 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
@@ -28,6 +28,7 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Predicate;
+import java.util.stream.Collectors;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.classloader.ClassLoaderUtil;
@@ -46,8 +47,6 @@ import org.apache.accumulo.server.ServerContext;
 import org.apache.accumulo.server.ServiceEnvironmentImpl;
 import org.apache.accumulo.server.conf.ZooCachePropertyAccessor.PropCacheKey;
 
-import com.google.common.collect.ImmutableMap;
-
 public class TableConfiguration extends AccumuloConfiguration {
 
   private static final Map<PropCacheKey,ZooCache> propCaches = new java.util.HashMap<>();
@@ -183,11 +182,8 @@ public class TableConfiguration extends AccumuloConfiguration {
     private ParsedIteratorConfig(List<IterInfo> ii, Map<String,Map<String,String>> opts,
         String context) {
       this.tableIters = List.copyOf(ii);
-      var imb = ImmutableMap.<String,Map<String,String>>builder();
-      for (Entry<String,Map<String,String>> entry : opts.entrySet()) {
-        imb.put(entry.getKey(), Map.copyOf(entry.getValue()));
-      }
-      tableOpts = imb.build();
+      tableOpts = opts.entrySet().stream()
+          .collect(Collectors.toUnmodifiableMap(Entry::getKey, e -> Map.copyOf(e.getValue())));
       this.context = context;
     }
 
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
index 47499f2..35345c0 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/FileUtil.java
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.security.SecureRandom;
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -46,7 +47,6 @@ import org.apache.accumulo.core.file.rfile.RFileOperations;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
 import org.apache.accumulo.core.iteratorsImpl.system.MultiIterator;
 import org.apache.accumulo.core.metadata.TabletFile;
-import org.apache.accumulo.core.util.LocalityGroupUtil;
 import org.apache.accumulo.server.ServerContext;
 import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.hadoop.conf.Configuration;
@@ -57,8 +57,6 @@ import org.apache.hadoop.io.WritableComparable;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import com.google.common.collect.ImmutableSortedMap;
-
 public class FileUtil {
 
   public static class FileInfo {
@@ -237,7 +235,7 @@ public class FileUtil {
       if (prevEndRow == null)
         prevEndRow = new Text();
 
-      long numKeys = 0;
+      long numKeys;
 
       numKeys = countIndexEntries(context, prevEndRow, endRow, mapFiles, true, readers);
 
@@ -322,7 +320,7 @@ public class FileUtil {
 
       long t1 = System.currentTimeMillis();
 
-      long numKeys = 0;
+      long numKeys;
 
       numKeys = countIndexEntries(context, prevEndRow, endRow, mapFiles,
           tmpDir == null ? useIndex : false, readers);
@@ -337,7 +335,7 @@ public class FileUtil {
           return findMidPoint(context, tabletDirectory, prevEndRow, endRow, origMapFiles, minSplit,
               false);
         }
-        return ImmutableSortedMap.of();
+        return Collections.emptySortedMap();
       }
 
       List<SortedKeyValueIterator<Key,Value>> iters = new ArrayList<>(readers);
@@ -443,9 +441,8 @@ public class FileUtil {
         else
           reader = FileOperations.getInstance().newScanReaderBuilder()
               .forFile(file.getPathStr(), ns, ns.getConf(), context.getCryptoService())
-              .withTableConfiguration(acuConf).overRange(new Range(prevEndRow, false, null, true),
-                  LocalityGroupUtil.EMPTY_CF_SET, false)
-              .build();
+              .withTableConfiguration(acuConf)
+              .overRange(new Range(prevEndRow, false, null, true), Set.of(), false).build();
 
         while (reader.hasTop()) {
           Key key = reader.getTopKey();
@@ -472,9 +469,8 @@ public class FileUtil {
       else
         readers.add(FileOperations.getInstance().newScanReaderBuilder()
             .forFile(file.getPathStr(), ns, ns.getConf(), context.getCryptoService())
-            .withTableConfiguration(acuConf).overRange(new Range(prevEndRow, false, null, true),
-                LocalityGroupUtil.EMPTY_CF_SET, false)
-            .build());
+            .withTableConfiguration(acuConf)
+            .overRange(new Range(prevEndRow, false, null, true), Set.of(), false).build());
 
     }
     return numKeys;
diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
index 3927be9..204f7d7 100644
--- a/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
+++ b/server/manager/src/main/java/org/apache/accumulo/manager/Manager.java
@@ -19,6 +19,7 @@
 package org.apache.accumulo.manager;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
+import static java.util.Collections.emptySortedMap;
 import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly;
 
 import java.io.IOException;
@@ -211,10 +212,8 @@ public class Manager extends AbstractServer
 
   Fate<Manager> fate;
 
-  volatile SortedMap<TServerInstance,TabletServerStatus> tserverStatus =
-      Collections.unmodifiableSortedMap(new TreeMap<>());
-  volatile SortedMap<TabletServerId,TServerStatus> tserverStatusForBalancer =
-      Collections.unmodifiableSortedMap(new TreeMap<>());
+  volatile SortedMap<TServerInstance,TabletServerStatus> tserverStatus = emptySortedMap();
+  volatile SortedMap<TabletServerId,TServerStatus> tserverStatusForBalancer = emptySortedMap();
   final ServerBulkImportStatus bulkImportStatus = new ServerBulkImportStatus();
 
   private final AtomicBoolean managerInitialized = new AtomicBoolean(false);
@@ -615,10 +614,8 @@ public class Manager extends AbstractServer
                 if (tls.chopped) {
                   return TabletGoalState.UNASSIGNED;
                 }
-              } else {
-                if (tls.chopped && tls.walogs.isEmpty()) {
-                  return TabletGoalState.UNASSIGNED;
-                }
+              } else if (tls.chopped && tls.walogs.isEmpty()) {
+                return TabletGoalState.UNASSIGNED;
               }
 
               return TabletGoalState.HOSTED;
@@ -1189,11 +1186,10 @@ public class Manager extends AbstractServer
     ThreadPools.createGeneralScheduledExecutorService(getConfiguration())
         .scheduleWithFixedDelay(() -> {
           try {
-            if (replServer.get() == null) {
-              if (!getConfiguration().get(Property.REPLICATION_NAME).isEmpty()) {
-                log.info(Property.REPLICATION_NAME.getKey() + " was set, starting repl services.");
-                replServer.set(setupReplication());
-              }
+            if ((replServer.get() == null)
+                && !getConfiguration().get(Property.REPLICATION_NAME).isEmpty()) {
+              log.info("{} was set, starting repl services.", Property.REPLICATION_NAME.getKey());
+              replServer.set(setupReplication());
             }
           } catch (UnknownHostException | KeeperException | InterruptedException e) {
             log.error("Error occurred starting replication services. ", e);
@@ -1497,10 +1493,9 @@ public class Manager extends AbstractServer
 
       Set<TServerInstance> unexpected = new HashSet<>(deleted);
       unexpected.removeAll(this.serversToShutdown);
-      if (!unexpected.isEmpty()) {
-        if (stillManager() && !getManagerGoalState().equals(ManagerGoalState.CLEAN_STOP)) {
-          log.warn("Lost servers {}", unexpected);
-        }
+      if (!unexpected.isEmpty()
+          && (stillManager() && !getManagerGoalState().equals(ManagerGoalState.CLEAN_STOP))) {
+        log.warn("Lost servers {}", unexpected);
       }
       serversToShutdown.removeAll(deleted);
       badServers.keySet().removeAll(deleted);
@@ -1582,10 +1577,8 @@ public class Manager extends AbstractServer
 
     for (TableId tableId : Tables.getIdToNameMap(context).keySet()) {
       TableState state = manager.getTableState(tableId);
-      if (state != null) {
-        if (state == TableState.ONLINE) {
-          result.add(tableId);
-        }
+      if ((state != null) && (state == TableState.ONLINE)) {
+        result.add(tableId);
       }
     }
     return result;
@@ -1620,16 +1613,12 @@ public class Manager extends AbstractServer
   }
 
   public void assignedTablet(KeyExtent extent) {
-    if (extent.isMeta()) {
-      if (getManagerState().equals(ManagerState.UNLOAD_ROOT_TABLET)) {
-        setManagerState(ManagerState.UNLOAD_METADATA_TABLETS);
-      }
+    if (extent.isMeta() && getManagerState().equals(ManagerState.UNLOAD_ROOT_TABLET)) {
+      setManagerState(ManagerState.UNLOAD_METADATA_TABLETS);
     }
-    if (extent.isRootTablet()) {
-      // probably too late, but try anyhow
-      if (getManagerState().equals(ManagerState.STOP)) {
-        setManagerState(ManagerState.UNLOAD_ROOT_TABLET);
-      }
+    // probably too late, but try anyhow
+    if (extent.isRootTablet() && getManagerState().equals(ManagerState.STOP)) {
+      setManagerState(ManagerState.UNLOAD_ROOT_TABLET);
     }
   }
 
diff --git a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
index 048eb44..d3fefbf 100644
--- a/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
+++ b/server/manager/src/main/java/org/apache/accumulo/manager/TabletGroupWatcher.java
@@ -106,7 +106,7 @@ abstract class TabletGroupWatcher extends Thread {
   private final TabletStateStore store;
   private final TabletGroupWatcher dependentWatcher;
   final TableStats stats = new TableStats();
-  private SortedSet<TServerInstance> lastScanServers = ImmutableSortedSet.of();
+  private SortedSet<TServerInstance> lastScanServers = Collections.emptySortedSet();
 
   TabletGroupWatcher(Manager manager, TabletStateStore store, TabletGroupWatcher dependentWatcher) {
     this.manager = manager;
@@ -198,7 +198,7 @@ abstract class TabletGroupWatcher extends Thread {
         if (currentTServers.isEmpty()) {
           eventListener.waitForEvents(Manager.TIME_TO_WAIT_BETWEEN_SCANS);
           synchronized (this) {
-            lastScanServers = ImmutableSortedSet.of();
+            lastScanServers = Collections.emptySortedSet();
           }
           continue;
         }
@@ -254,19 +254,17 @@ abstract class TabletGroupWatcher extends Thread {
           }
 
           // if we are shutting down all the tabletservers, we have to do it in order
-          if (goal == TabletGoalState.SUSPENDED && state == TabletState.HOSTED) {
-            if (manager.serversToShutdown.equals(currentTServers.keySet())) {
-              if (dependentWatcher != null && dependentWatcher.assignedOrHosted() > 0) {
-                goal = TabletGoalState.HOSTED;
-              }
+          if ((goal == TabletGoalState.SUSPENDED && state == TabletState.HOSTED)
+              && manager.serversToShutdown.equals(currentTServers.keySet())) {
+            if (dependentWatcher != null && dependentWatcher.assignedOrHosted() > 0) {
+              goal = TabletGoalState.HOSTED;
             }
           }
 
           if (goal == TabletGoalState.HOSTED) {
-            if (state != TabletState.HOSTED && !tls.walogs.isEmpty()) {
-              if (manager.recoveryManager.recoverLogs(tls.extent, tls.walogs))
-                continue;
-            }
+            if ((state != TabletState.HOSTED && !tls.walogs.isEmpty())
+                && manager.recoveryManager.recoverLogs(tls.extent, tls.walogs))
+              continue;
             switch (state) {
               case HOSTED:
                 if (location.equals(manager.migrations.get(tls.extent)))
diff --git a/server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/PrepBulkImportTest.java b/server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/PrepBulkImportTest.java
index 36fb7b6..9199fd4 100644
--- a/server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/PrepBulkImportTest.java
+++ b/server/manager/src/test/java/org/apache/accumulo/manager/tableOps/bulkVer2/PrepBulkImportTest.java
@@ -80,7 +80,7 @@ public class PrepBulkImportTest {
   }
 
   Iterable<List<KeyExtent>> powerSet(KeyExtent... extents) {
-    Set<Set<KeyExtent>> powerSet = Sets.powerSet(Set.copyOf(Arrays.asList(extents)));
+    Set<Set<KeyExtent>> powerSet = Sets.powerSet(Set.of(extents));
 
     return Iterables.transform(powerSet, set -> {
       List<KeyExtent> list = new ArrayList<>(set);
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/OnlineTablets.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/OnlineTablets.java
index cdeb66b..baf098b 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/OnlineTablets.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/OnlineTablets.java
@@ -18,6 +18,7 @@
  */
 package org.apache.accumulo.tserver;
 
+import java.util.Collections;
 import java.util.SortedMap;
 import java.util.TreeMap;
 
@@ -32,7 +33,7 @@ import com.google.common.collect.ImmutableSortedMap;
  * threads can access the snapshot without interfering with each other.
  */
 public class OnlineTablets {
-  private volatile ImmutableSortedMap<KeyExtent,Tablet> snapshot = ImmutableSortedMap.of();
+  private volatile SortedMap<KeyExtent,Tablet> snapshot = Collections.emptySortedMap();
   private final SortedMap<KeyExtent,Tablet> onlineTablets = new TreeMap<>();
 
   public synchronized void put(KeyExtent ke, Tablet t) {
@@ -52,7 +53,7 @@ public class OnlineTablets {
     snapshot = ImmutableSortedMap.copyOf(onlineTablets);
   }
 
-  ImmutableSortedMap<KeyExtent,Tablet> snapshot() {
+  SortedMap<KeyExtent,Tablet> snapshot() {
     return snapshot;
   }
 }
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
index 80bded7..941a654 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
@@ -19,6 +19,7 @@
 package org.apache.accumulo.tserver;
 
 import static java.util.Objects.requireNonNull;
+import static java.util.stream.Collectors.toUnmodifiableMap;
 import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly;
 
 import java.io.IOException;
@@ -79,7 +80,6 @@ import org.slf4j.LoggerFactory;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
-import com.google.common.collect.ImmutableMap;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
@@ -157,7 +157,7 @@ public class TabletServerResourceManager {
   }
 
   private ExecutorService createPriorityExecutor(ScanExecutorConfig sec,
-      Map<String,Queue<?>> scanExecQueues) {
+      Map<String,Queue<Runnable>> scanExecQueues) {
 
     BlockingQueue<Runnable> queue;
 
@@ -209,17 +209,6 @@ public class TabletServerResourceManager {
 
   }
 
-  protected Map<String,ExecutorService> createScanExecutors(
-      Collection<ScanExecutorConfig> scanExecCfg, Map<String,Queue<?>> scanExecQueues) {
-    var builder = ImmutableMap.<String,ExecutorService>builder();
-
-    for (ScanExecutorConfig sec : scanExecCfg) {
-      builder.put(sec.name, createPriorityExecutor(sec, scanExecQueues));
-    }
-
-    return builder.build();
-  }
-
   private static class ScanExecutorImpl implements ScanExecutor {
 
     private static class ConfigImpl implements ScanExecutor.Config {
@@ -272,17 +261,6 @@ public class TabletServerResourceManager {
 
   }
 
-  private Map<String,ScanExecutor> createScanExecutorChoices(
-      Collection<ScanExecutorConfig> scanExecCfg, Map<String,Queue<?>> scanExecQueues) {
-    var builder = ImmutableMap.<String,ScanExecutor>builder();
-
-    for (ScanExecutorConfig sec : scanExecCfg) {
-      builder.put(sec.name, new ScanExecutorImpl(sec, scanExecQueues.get(sec.name)));
-    }
-
-    return builder.build();
-  }
-
   @SuppressFBWarnings(value = "DM_GC",
       justification = "GC is run to get a good estimate of memory availability")
   public TabletServerResourceManager(ServerContext context) {
@@ -392,9 +370,11 @@ public class TabletServerResourceManager {
         "summary partition", (ThreadPoolExecutor) summaryParitionPool);
 
     Collection<ScanExecutorConfig> scanExecCfg = acuConf.getScanExecutors();
-    Map<String,Queue<?>> scanExecQueues = new HashMap<>();
-    scanExecutors = createScanExecutors(scanExecCfg, scanExecQueues);
-    scanExecutorChoices = createScanExecutorChoices(scanExecCfg, scanExecQueues);
+    Map<String,Queue<Runnable>> scanExecQueues = new HashMap<>();
+    scanExecutors = scanExecCfg.stream().collect(
+        toUnmodifiableMap(cfg -> cfg.name, cfg -> createPriorityExecutor(cfg, scanExecQueues)));
+    scanExecutorChoices = scanExecCfg.stream().collect(toUnmodifiableMap(cfg -> cfg.name,
+        cfg -> new ScanExecutorImpl(cfg, scanExecQueues.get(cfg.name))));
 
     int maxOpenFiles = acuConf.getCount(Property.TSERV_SCAN_MAX_OPENFILES);
 
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 4e9406f..ca8a3bb 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -44,6 +44,8 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.concurrent.locks.ReentrantLock;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.Durability;
@@ -133,7 +135,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import com.google.common.base.Preconditions;
-import com.google.common.collect.ImmutableSet;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
@@ -494,7 +495,7 @@ public class Tablet {
         if (cfset != null) {
           mmfi.seek(range, cfset, true);
         } else {
-          mmfi.seek(range, LocalityGroupUtil.EMPTY_CF_SET, false);
+          mmfi.seek(range, Set.of(), false);
         }
 
         while (mmfi.hasTop()) {
@@ -697,7 +698,7 @@ public class Tablet {
     }
 
     if (scanParams.getColumnSet().isEmpty()) {
-      iter.seek(range, LocalityGroupUtil.EMPTY_CF_SET, false);
+      iter.seek(range, Set.of(), false);
     } else {
       iter.seek(range, LocalityGroupUtil.families(scanParams.getColumnSet()), true);
     }
@@ -1867,10 +1868,8 @@ public class Tablet {
 
     var prev = referencedLogs;
 
-    var builder = ImmutableSet.<DfsLogger>builder();
-    builder.addAll(currentLogs);
-    builder.addAll(otherLogs);
-    referencedLogs = builder.build();
+    referencedLogs = Stream.concat(currentLogs.stream(), otherLogs.stream())
+        .collect(Collectors.toUnmodifiableSet());
 
     if (TabletLogger.isWalRefLoggingEnabled() && !prev.equals(referencedLogs)) {
       TabletLogger.walRefsChanged(extent,
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
index 9f4278f..819bca3 100644
--- a/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/InMemoryMapTest.java
@@ -181,10 +181,10 @@ public class InMemoryMapTest {
     mutate(imm, "r1", "foo:cq1", 3, "bar1");
     MemoryIterator ski2 = imm.skvIterator(null);
 
-    ski1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(), Set.of(), false);
     assertFalse(ski1.hasTop());
 
-    ski2.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski2.seek(new Range(), Set.of(), false);
     assertTrue(ski2.hasTop());
     testAndCallNext(ski2, "r1", "foo:cq1", 3, "bar1");
     assertFalse(ski2.hasTop());
@@ -205,12 +205,12 @@ public class InMemoryMapTest {
 
     MemoryIterator ski2 = imm.skvIterator(null);
 
-    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r1")), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar2");
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar1");
     assertFalse(ski1.hasTop());
 
-    ski2.seek(new Range(new Text("r3")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski2.seek(new Range(new Text("r3")), Set.of(), false);
     testAndCallNext(ski2, "r3", "foo:cq1", 3, "bara");
     testAndCallNext(ski2, "r3", "foo:cq1", 3, "bar9");
     assertFalse(ski1.hasTop());
@@ -228,20 +228,20 @@ public class InMemoryMapTest {
 
     imm.delete(0);
 
-    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r1")), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar2");
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar1");
     assertFalse(ski1.hasTop());
 
-    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r1")), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar2");
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar1");
     assertFalse(ski1.hasTop());
 
-    ski1.seek(new Range(new Text("r2")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r2")), Set.of(), false);
     assertFalse(ski1.hasTop());
 
-    ski1.seek(new Range(newKey("r1", "foo:cq1", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(newKey("r1", "foo:cq1", 3), null), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar2");
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar1");
     assertFalse(ski1.hasTop());
@@ -259,9 +259,9 @@ public class InMemoryMapTest {
 
     imm.delete(0);
 
-    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r1")), Set.of(), false);
     assertEqualsNoNext(ski1, "r1", "foo:cq1", 3, "");
-    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r1")), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "");
     assertFalse(ski1.hasTop());
 
@@ -277,7 +277,7 @@ public class InMemoryMapTest {
     mutate(imm, "r1", "foo:cq1", 3, "bar3");
 
     MemoryIterator ski1 = imm.skvIterator(null);
-    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r1")), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar3");
 
     imm.delete(0);
@@ -295,7 +295,7 @@ public class InMemoryMapTest {
     mutate(imm, "r1", "foo:cq3", 3, "bar3");
 
     ski1 = imm.skvIterator(null);
-    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(new Text("r1")), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar1");
 
     imm.delete(0);
@@ -322,10 +322,10 @@ public class InMemoryMapTest {
 
     SortedKeyValueIterator<Key,Value> dc = ski1.deepCopy(new SampleIE());
 
-    ski1.seek(new Range(newKey("r1", "foo:cq1", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(newKey("r1", "foo:cq1", 3), null), Set.of(), false);
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar1");
 
-    dc.seek(new Range(newKey("r1", "foo:cq2", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
+    dc.seek(new Range(newKey("r1", "foo:cq2", 3), null), Set.of(), false);
     testAndCallNext(dc, "r1", "foo:cq2", 3, "bar2");
 
     imm.delete(0);
@@ -338,9 +338,9 @@ public class InMemoryMapTest {
     assertFalse(ski1.hasTop());
     assertFalse(dc.hasTop());
 
-    ski1.seek(new Range(newKey("r1", "foo:cq3", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
+    ski1.seek(new Range(newKey("r1", "foo:cq3", 3), null), Set.of(), false);
 
-    dc.seek(new Range(newKey("r1", "foo:cq4", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
+    dc.seek(new Range(newKey("r1", "foo:cq4", 3), null), Set.of(), false);
     testAndCallNext(dc, "r1", "foo:cq4", 3, "bar4");
     assertFalse(dc.hasTop());
 
@@ -381,8 +381,8 @@ public class InMemoryMapTest {
       }
     }
 
-    dc.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
-    ski1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    dc.seek(new Range(), Set.of(), false);
+    ski1.seek(new Range(), Set.of(), false);
 
     if (interleaving == 3) {
       imm.delete(0);
@@ -393,7 +393,7 @@ public class InMemoryMapTest {
 
     testAndCallNext(dc, "r1", "foo:cq1", 3, "bar1");
     testAndCallNext(ski1, "r1", "foo:cq1", 3, "bar1");
-    dc.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    dc.seek(new Range(), Set.of(), false);
 
     if (interleaving == 4) {
       imm.delete(0);
@@ -409,7 +409,7 @@ public class InMemoryMapTest {
     assertFalse(ski1.hasTop());
 
     if (interrupt) {
-      dc.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+      dc.seek(new Range(), Set.of(), false);
     }
   }
 
@@ -466,10 +466,10 @@ public class InMemoryMapTest {
 
     MemoryIterator skvi1 = imm.skvIterator(null);
 
-    skvi1.seek(new Range(newKey("r1", "foo:cq3", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
+    skvi1.seek(new Range(newKey("r1", "foo:cq3", 3), null), Set.of(), false);
     testAndCallNext(skvi1, "r1", "foo:cq3", 3, "bar3");
 
-    skvi1.seek(new Range(newKey("r1", "foo:cq1", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
+    skvi1.seek(new Range(newKey("r1", "foo:cq1", 3), null), Set.of(), false);
     testAndCallNext(skvi1, "r1", "foo:cq1", 3, "bar1");
 
   }
@@ -484,7 +484,7 @@ public class InMemoryMapTest {
     imm.mutate(Collections.singletonList(m), 2);
 
     MemoryIterator skvi1 = imm.skvIterator(null);
-    skvi1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    skvi1.seek(new Range(), Set.of(), false);
     testAndCallNext(skvi1, "r1", "foo:cq", 3, "v2");
     testAndCallNext(skvi1, "r1", "foo:cq", 3, "v1");
   }
@@ -713,7 +713,7 @@ public class InMemoryMapTest {
     SamplerConfigurationImpl sampleConfig2 = new SamplerConfigurationImpl(
         RowSampler.class.getName(), Map.of("hasher", "murmur3_32", "modulus", "9"));
     MemoryIterator iter = imm.skvIterator(sampleConfig2);
-    iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    iter.seek(new Range(), Set.of(), false);
   }
 
   @Test(expected = SampleNotPresentException.class)
@@ -725,7 +725,7 @@ public class InMemoryMapTest {
     SamplerConfigurationImpl sampleConfig2 = new SamplerConfigurationImpl(
         RowSampler.class.getName(), Map.of("hasher", "murmur3_32", "modulus", "9"));
     MemoryIterator iter = imm.skvIterator(sampleConfig2);
-    iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    iter.seek(new Range(), Set.of(), false);
   }
 
   @Test
@@ -737,7 +737,7 @@ public class InMemoryMapTest {
 
     // when in mem map is empty should be able to get sample iterator with any sample config
     MemoryIterator iter = imm.skvIterator(sampleConfig2);
-    iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    iter.seek(new Range(), Set.of(), false);
     assertFalse(iter.hasTop());
   }
 
@@ -769,24 +769,24 @@ public class InMemoryMapTest {
     }
 
     MemoryIterator iter = imm.skvIterator(sampleConfig2);
-    iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    iter.seek(new Range(), Set.of(), false);
     assertEquals(expectedSample, readAll(iter));
 
     SortedKeyValueIterator<Key,Value> dc = iter.deepCopy(new SampleIE(sampleConfig2));
-    dc.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    dc.seek(new Range(), Set.of(), false);
     assertEquals(expectedSample, readAll(dc));
 
     iter = imm.skvIterator(null);
-    iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    iter.seek(new Range(), Set.of(), false);
     assertEquals(expectedAll, readAll(iter));
 
     final MemoryIterator finalIter = imm.skvIterator(sampleConfig1);
     assertThrows(SampleNotPresentException.class,
-        () -> finalIter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false));
+        () -> finalIter.seek(new Range(), Set.of(), false));
   }
 
   private TreeMap<Key,Value> readAll(SortedKeyValueIterator<Key,Value> iter) throws IOException {
-    iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    iter.seek(new Range(), Set.of(), false);
 
     TreeMap<Key,Value> actual = new TreeMap<>();
     while (iter.hasTop()) {
@@ -846,7 +846,7 @@ public class InMemoryMapTest {
     testAndCallNext(iter1, "r2", "cf2:x", 3, "5");
     assertFalse(iter1.hasTop());
 
-    iter1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
+    iter1.seek(new Range(), Set.of(), false);
     assertAll(iter1);
 
     iter1.seek(new Range(), newCFSet("cf1"), false);
diff --git a/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java b/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
index ba4edab..ef80211 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/ShellUtil.java
@@ -23,18 +23,19 @@ import static java.nio.charset.StandardCharsets.UTF_8;
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Base64;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.Scanner;
+import java.util.stream.Collectors;
 
+import org.apache.accumulo.core.util.Pair;
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.hadoop.io.Text;
 
-import com.google.common.collect.ImmutableMap;
-
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
 
 public class ShellUtil {
@@ -68,14 +69,10 @@ public class ShellUtil {
 
   public static Map<String,String> parseMapOpt(CommandLine cl, Option opt) {
     if (cl.hasOption(opt.getLongOpt())) {
-      var builder = ImmutableMap.<String,String>builder();
-      String[] keyVals = cl.getOptionValue(opt.getLongOpt()).split(",");
-      for (String keyVal : keyVals) {
-        String[] sa = keyVal.split("=");
-        builder.put(sa[0], sa[1]);
-      }
-
-      return builder.build();
+      return Arrays.stream(cl.getOptionValue(opt.getLongOpt()).split(",")).map(kv -> {
+        String[] sa = kv.split("=");
+        return new Pair<>(sa[0], sa[1]);
+      }).collect(Collectors.toUnmodifiableMap(Pair::getFirst, Pair::getSecond));
     } else {
       return Collections.emptyMap();
     }
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
index ed2ae6b..b96a0d9 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SummaryIT.java
@@ -47,7 +47,10 @@ import java.util.Random;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
+import java.util.function.IntPredicate;
 import java.util.regex.PatternSyntaxException;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
 import java.util.stream.Stream;
 import java.util.stream.StreamSupport;
 
@@ -87,7 +90,6 @@ import org.apache.accumulo.harness.AccumuloClusterHarness;
 import org.apache.hadoop.io.Text;
 import org.junit.Test;
 
-import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Lists;
 
@@ -752,11 +754,9 @@ public class SummaryIT extends AccumuloClusterHarness {
   }
 
   private Map<String,Long> nm(Object... entries) {
-    var imb = ImmutableMap.<String,Long>builder();
-    for (int i = 0; i < entries.length; i += 2) {
-      imb.put((String) entries[i], (Long) entries[i + 1]);
-    }
-    return imb.build();
+    IntPredicate evenIndex = i -> i % 2 == 0;
+    return IntStream.range(0, entries.length).filter(evenIndex).boxed().collect(
+        Collectors.toUnmodifiableMap(i -> (String) entries[i], i -> (Long) entries[i + 1]));
   }
 
   @Test