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 2020/01/30 20:41:40 UTC

[accumulo] 02/02: Clean up warnings in master branch

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

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

commit 0216247a10cdc564901623c0d9856f6513b94f4a
Author: Christopher Tubbs <ct...@apache.org>
AuthorDate: Thu Jan 30 15:13:36 2020 -0500

    Clean up warnings in master branch
    
    * Remove deprecation warnings related to internal use of
      DispatchParmaters (sic)
      This change also removed redundant modifiers
    * Remove unused variables
    * Add missing `@Deprecated` annotation
    * Ensure test coverage of `getPluginEnv` in `IteratorEnvIT`
---
 .../accumulo/core/spi/scan/ScanDispatcher.java       | 20 ++++----------------
 .../accumulo/server/fs/PerTableVolumeChooser.java    |  1 -
 .../accumulo/server/util/MetadataTableUtil.java      |  2 --
 .../accumulo/tserver/TabletIteratorEnvironment.java  |  1 +
 .../tserver/TabletServerResourceManager.java         |  5 ++---
 .../java/org/apache/accumulo/test/IteratorEnvIT.java |  3 +++
 6 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/core/src/main/java/org/apache/accumulo/core/spi/scan/ScanDispatcher.java b/core/src/main/java/org/apache/accumulo/core/spi/scan/ScanDispatcher.java
index bd0012c..8806b82 100644
--- a/core/src/main/java/org/apache/accumulo/core/spi/scan/ScanDispatcher.java
+++ b/core/src/main/java/org/apache/accumulo/core/spi/scan/ScanDispatcher.java
@@ -41,7 +41,7 @@ public interface ScanDispatcher {
    *
    * @since 2.0.0
    */
-  public static interface InitParameters {
+  public interface InitParameters {
     /**
      *
      * @return The configured options. For example if the table properties
@@ -59,7 +59,7 @@ public interface ScanDispatcher {
   /**
    * This method is called once after a ScanDispatcher is instantiated.
    */
-  public default void init(InitParameters params) {
+  default void init(InitParameters params) {
     Preconditions.checkArgument(params.getOptions().isEmpty(), "No options expected");
   }
 
@@ -73,19 +73,7 @@ public interface ScanDispatcher {
    *             {@link ScanDispatcher#dispatch(DispatchParameters)}
    */
   @Deprecated
-  public static interface DispatchParmaters {
-    /**
-     * @return information about the scan to be dispatched.
-     */
-    ScanInfo getScanInfo();
-
-    /**
-     * @return the currently configured scan executors
-     */
-    Map<String,ScanExecutor> getScanExecutors();
-
-    ServiceEnvironment getServiceEnv();
-  }
+  public interface DispatchParmaters extends DispatchParameters {}
 
   /**
    * @return Should return one of the executors named params.getScanExecutors().keySet()
@@ -107,7 +95,7 @@ public interface ScanDispatcher {
    *
    * @since 2.1.0
    */
-  public static interface DispatchParameters {
+  public interface DispatchParameters {
     /**
      * @return information about the scan to be dispatched.
      */
diff --git a/server/base/src/main/java/org/apache/accumulo/server/fs/PerTableVolumeChooser.java b/server/base/src/main/java/org/apache/accumulo/server/fs/PerTableVolumeChooser.java
index 24d2ede..a99d60e 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/fs/PerTableVolumeChooser.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/fs/PerTableVolumeChooser.java
@@ -41,7 +41,6 @@ public class PerTableVolumeChooser implements VolumeChooser {
       new ConcurrentHashMap<>();
   private final ConcurrentHashMap<ChooserScope,VolumeChooser> scopeSpecificChooserCache =
       new ConcurrentHashMap<>();
-  private final RandomVolumeChooser randomChooser = new RandomVolumeChooser();
 
   private static final String TABLE_CUSTOM_SUFFIX = "volume.chooser";
 
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index b37ef66..083b8de 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -273,8 +273,6 @@ public class MetadataTableUtil {
   public static void addDeleteEntries(KeyExtent extent, Set<FileRef> datafilesToDelete,
       ServerContext context) {
 
-    TableId tableId = extent.getTableId();
-
     // TODO could use batch writer,would need to handle failure and retry like update does -
     // ACCUMULO-1294
     for (FileRef pathToRemove : datafilesToDelete) {
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
index 252f557..ebfef77 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletIteratorEnvironment.java
@@ -219,6 +219,7 @@ public class TabletIteratorEnvironment implements SystemIteratorEnvironment {
     return context;
   }
 
+  @Deprecated
   @Override
   public ServiceEnvironment getServiceEnv() {
     return serviceEnvironment;
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 72c5163..75029b6 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
@@ -62,7 +62,6 @@ import org.apache.accumulo.core.spi.common.ServiceEnvironment;
 import org.apache.accumulo.core.spi.scan.ScanDirectives;
 import org.apache.accumulo.core.spi.scan.ScanDispatcher;
 import org.apache.accumulo.core.spi.scan.ScanDispatcher.DispatchParameters;
-import org.apache.accumulo.core.spi.scan.ScanDispatcher.DispatchParmaters;
 import org.apache.accumulo.core.spi.scan.ScanExecutor;
 import org.apache.accumulo.core.spi.scan.ScanInfo;
 import org.apache.accumulo.core.spi.scan.ScanPrioritizer;
@@ -929,8 +928,8 @@ public class TabletServerResourceManager {
   }
 
   @SuppressWarnings("deprecation")
-  private static abstract class DispatchParamsImpl
-      implements DispatchParameters, DispatchParmaters {
+  private static abstract class DispatchParamsImpl implements DispatchParameters,
+      org.apache.accumulo.core.spi.scan.ScanDispatcher.DispatchParmaters {
 
   }
 
diff --git a/test/src/main/java/org/apache/accumulo/test/IteratorEnvIT.java b/test/src/main/java/org/apache/accumulo/test/IteratorEnvIT.java
index 46c45c8..b8d5c2e 100644
--- a/test/src/main/java/org/apache/accumulo/test/IteratorEnvIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/IteratorEnvIT.java
@@ -149,6 +149,9 @@ public class IteratorEnvIT extends AccumuloClusterHarness {
     if (!"value1".equals(env.getConfig().get("table.custom.iterator.env.test")) && !"value1".equals(
         env.getServiceEnv().getConfiguration(env.getTableId()).getTableCustom("iterator.env.test")))
       throw new RuntimeException("Test failed - Expected table property not found.");
+    if (!"value1".equals(env.getConfig().get("table.custom.iterator.env.test")) && !"value1".equals(
+        env.getPluginEnv().getConfiguration(env.getTableId()).getTableCustom("iterator.env.test")))
+      throw new RuntimeException("Test failed - Expected table property not found.");
     if (!scope.equals(env.getIteratorScope()))
       throw new RuntimeException("Test failed - Error getting iterator scope");
     if (env.isSamplingEnabled())