accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch 2.0 updated: Fix more tests building 2.0 with Java 11 (#1215)
Date Sun, 16 Jun 2019 21:48:05 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2.0 by this push:
     new 0e89ab2  Fix more tests building 2.0 with Java 11 (#1215)
0e89ab2 is described below

commit 0e89ab238b14d257f9f901a36a9b87a7491c1ea9
Author: Christopher Tubbs <ctubbsii@apache.org>
AuthorDate: Sun Jun 16 17:48:01 2019 -0400

    Fix more tests building 2.0 with Java 11 (#1215)
    
    * Fix more tests building 2.0 with Java 11
    
    * Update monitor dependencies to release versions (instead of beta
      versions) for WebViewsIT
    * Simplify parameters to TabletServerResourceManager (everything it
      needs is in the ServerContext; other params were redundant)
    * Ensure TabletServerResourceManager updates the dynamic thread pools in
      the correct order (cannot increase the corePoolSize before increasing
      the maxPoolSize)
    * Make ShellServerIT.classpath test handle output under Java 11
    * Convert dubious DynamicThreadPoolsIT from an IT to a unit test
      (TabletServerResourceManagerDynamicCompactionPoolTest)
    * Give SimpleGarbageCollector 16MB of memory instead of 10MB for its
      gcLotsOfCandidatesIT test, so it doesn't crash under Java 11 before the
      test runs (Java 11 needs slightly more base memory, it appears)
---
 assemble/pom.xml                                   |   2 +-
 assemble/src/main/assemblies/component.xml         |   2 +-
 pom.xml                                            |   8 +-
 server/monitor/pom.xml                             |   8 +-
 .../org/apache/accumulo/tserver/TabletServer.java  |   2 +-
 .../tserver/TabletServerResourceManager.java       |  49 +++----
 ...erResourceManagerDynamicCompactionPoolTest.java | 159 +++++++++++++++++++++
 .../org/apache/accumulo/test/ShellServerIT.java    |   4 +-
 .../test/functional/DynamicThreadPoolsIT.java      | 130 -----------------
 .../test/functional/GarbageCollectorIT.java        |   5 +-
 10 files changed, 197 insertions(+), 172 deletions(-)

diff --git a/assemble/pom.xml b/assemble/pom.xml
index a86dc9b..c45c7ea 100644
--- a/assemble/pom.xml
+++ b/assemble/pom.xml
@@ -355,7 +355,7 @@
     </dependency>
     <dependency>
       <groupId>org.glassfish.hk2.external</groupId>
-      <artifactId>javax.inject</artifactId>
+      <artifactId>jakarta.inject</artifactId>
       <optional>true</optional>
     </dependency>
     <dependency>
diff --git a/assemble/src/main/assemblies/component.xml b/assemble/src/main/assemblies/component.xml
index a8dee60..d8fcd98 100644
--- a/assemble/src/main/assemblies/component.xml
+++ b/assemble/src/main/assemblies/component.xml
@@ -77,7 +77,7 @@
         <include>org.eclipse.jetty:jetty-util</include>
         <include>org.freemarker:freemarker</include>
         <include>org.glassfish.hk2.external:aopalliance-repackaged</include>
-        <include>org.glassfish.hk2.external:javax.inject</include>
+        <include>org.glassfish.hk2.external:jakarta.inject</include>
         <include>org.glassfish.hk2:hk2-api</include>
         <include>org.glassfish.hk2:hk2-locator</include>
         <include>org.glassfish.hk2:hk2-utils</include>
diff --git a/pom.xml b/pom.xml
index e8ada85..6e569be 100644
--- a/pom.xml
+++ b/pom.xml
@@ -123,12 +123,12 @@
     <!-- surefire/failsafe plugin option -->
     <forkCount>1</forkCount>
     <hadoop.version>3.1.1</hadoop.version>
-    <hk2.version>2.5.0-b62</hk2.version>
+    <hk2.version>2.5.0</hk2.version>
     <htrace.hadoop.version>4.1.0-incubating</htrace.hadoop.version>
     <htrace.version>3.2.0-incubating</htrace.version>
     <it.failIfNoSpecifiedTests>false</it.failIfNoSpecifiedTests>
     <jackson.version>2.9.9</jackson.version>
-    <javax.el.version>2.2.4</javax.el.version>
+    <javax.el.version>3.0.1-b06</javax.el.version>
     <jaxb.version>2.3.0</jaxb.version>
     <jersey.version>2.27</jersey.version>
     <jetty.version>9.4.17.v20190418</jetty.version>
@@ -614,7 +614,7 @@
       </dependency>
       <dependency>
         <groupId>org.glassfish.hk2.external</groupId>
-        <artifactId>javax.inject</artifactId>
+        <artifactId>jakarta.inject</artifactId>
         <version>${hk2.version}</version>
       </dependency>
       <dependency>
@@ -710,7 +710,7 @@
       <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-validator</artifactId>
-        <version>5.1.3.Final</version>
+        <version>6.0.17.Final</version>
       </dependency>
       <dependency>
         <groupId>org.javassist</groupId>
diff --git a/server/monitor/pom.xml b/server/monitor/pom.xml
index 1534ed4..a8f574f 100644
--- a/server/monitor/pom.xml
+++ b/server/monitor/pom.xml
@@ -103,16 +103,10 @@
     <dependency>
       <groupId>org.glassfish.hk2</groupId>
       <artifactId>hk2-api</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>javax.inject</groupId>
-          <artifactId>javax.inject</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.glassfish.hk2.external</groupId>
-      <artifactId>javax.inject</artifactId>
+      <artifactId>jakarta.inject</artifactId>
     </dependency>
     <dependency>
       <groupId>org.glassfish.jersey.containers</groupId>
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 11df49f..a23ae99 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -413,7 +413,7 @@ public class TabletServer extends AbstractServer {
 
     logger = new TabletServerLogger(this, walogMaxSize, syncCounter, flushCounter,
         walCreationRetryFactory, walWritingRetryFactory, walogMaxAge);
-    this.resourceManager = new TabletServerResourceManager(this, fs, context);
+    this.resourceManager = new TabletServerResourceManager(context);
     this.security = AuditedSecurityOperation.getInstance(context);
 
     updateMetrics = new TabletServerUpdateMetrics();
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 b9804d3..7c8db69 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
@@ -67,9 +67,7 @@ import org.apache.accumulo.core.util.NamingThreadFactory;
 import org.apache.accumulo.fate.util.LoggingRunnable;
 import org.apache.accumulo.server.ServerContext;
 import org.apache.accumulo.server.ServiceEnvironmentImpl;
-import org.apache.accumulo.server.conf.ServerConfigurationFactory;
 import org.apache.accumulo.server.fs.FileRef;
-import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.server.tabletserver.LargestFirstMemoryManager;
 import org.apache.accumulo.server.tabletserver.MemoryManagementActions;
 import org.apache.accumulo.server.tabletserver.MemoryManager;
@@ -133,8 +131,6 @@ public class TabletServerResourceManager {
   private final BlockCache _dCache;
   private final BlockCache _iCache;
   private final BlockCache _sCache;
-  private final TabletServer tserver;
-  private final ServerConfigurationFactory conf;
   private final ServerContext context;
 
   private Cache<String,Long> fileLenCache;
@@ -151,33 +147,41 @@ public class TabletServerResourceManager {
 
   private ExecutorService addEs(IntSupplier maxThreads, String name, final ThreadPoolExecutor
tp) {
     ExecutorService result = addEs(name, tp);
-    SimpleTimer.getInstance(tserver.getConfiguration()).schedule(new Runnable() {
+    SimpleTimer.getInstance(context.getConfiguration()).schedule(new Runnable() {
       @Override
       public void run() {
         try {
           int max = maxThreads.getAsInt();
-          if (tp.getMaximumPoolSize() != max) {
-            log.info("Changing max threads for {} to {}", name, max);
-            tp.setCorePoolSize(max);
-            tp.setMaximumPoolSize(max);
+          int currentMax = tp.getMaximumPoolSize();
+          if (currentMax != max) {
+            log.info("Changing max threads for {} from {} to {}", name, currentMax, max);
+            if (max > currentMax) {
+              // increasing, increase the max first, or the core will fail to be increased
+              tp.setMaximumPoolSize(max);
+              tp.setCorePoolSize(max);
+            } else {
+              // decreasing, lower the core size first, or the max will fail to be lowered
+              tp.setCorePoolSize(max);
+              tp.setMaximumPoolSize(max);
+            }
           }
         } catch (Throwable t) {
           log.error("Failed to change thread pool size", t);
         }
       }
 
-    }, 1000, 10 * 1000);
+    }, 1000, 10_000);
     return result;
   }
 
   private ExecutorService createIdlingEs(Property max, String name, long timeout,
       TimeUnit timeUnit) {
     LinkedBlockingQueue<Runnable> queue = new LinkedBlockingQueue<>();
-    int maxThreads = conf.getSystemConfiguration().getCount(max);
+    int maxThreads = context.getConfiguration().getCount(max);
     ThreadPoolExecutor tp = new ThreadPoolExecutor(maxThreads, maxThreads, timeout, timeUnit,
queue,
         new NamingThreadFactory(name));
     tp.allowCoreThreadTimeOut(true);
-    return addEs(() -> conf.getSystemConfiguration().getCount(max), name, tp);
+    return addEs(() -> context.getConfiguration().getCount(max), name, tp);
   }
 
   private ExecutorService createEs(int max, String name) {
@@ -244,7 +248,7 @@ public class TabletServerResourceManager {
   }
 
   private ExecutorService createEs(Property max, String name, BlockingQueue<Runnable>
queue) {
-    IntSupplier maxThreadsSupplier = () -> conf.getSystemConfiguration().getCount(max);
+    IntSupplier maxThreadsSupplier = () -> context.getConfiguration().getCount(max);
     return createEs(maxThreadsSupplier, name, queue, OptionalInt.empty());
   }
 
@@ -329,12 +333,9 @@ public class TabletServerResourceManager {
 
   @SuppressFBWarnings(value = "DM_GC",
       justification = "GC is run to get a good estimate of memory availability")
-  public TabletServerResourceManager(TabletServer tserver, VolumeManager fs,
-      ServerContext context) {
-    this.tserver = tserver;
-    this.conf = tserver.getContext().getServerConfFactory();
+  public TabletServerResourceManager(ServerContext context) {
     this.context = context;
-    final AccumuloConfiguration acuConf = conf.getSystemConfiguration();
+    final AccumuloConfiguration acuConf = context.getConfiguration();
 
     long maxMemory = acuConf.getAsBytes(Property.TSERV_MAXMEM);
     boolean usingNativeMap =
@@ -427,16 +428,16 @@ public class TabletServerResourceManager {
     fileLenCache =
         CacheBuilder.newBuilder().maximumSize(Math.min(maxOpenFiles * 1000L, 100_000)).build();
 
-    fileManager =
-        new FileManager(tserver.getContext(), fs, maxOpenFiles, fileLenCache, _dCache, _iCache);
+    fileManager = new FileManager(context, context.getVolumeManager(), maxOpenFiles, fileLenCache,
+        _dCache, _iCache);
 
     memoryManager = Property.createInstanceFromPropertyName(acuConf, Property.TSERV_MEM_MGMT,
         MemoryManager.class, new LargestFirstMemoryManager());
-    memoryManager.init(tserver.getContext().getServerConfFactory());
+    memoryManager.init(context.getServerConfFactory());
     memMgmt = new MemoryManagementFramework();
     memMgmt.startThreads();
 
-    SimpleTimer timer = SimpleTimer.getInstance(tserver.getConfiguration());
+    SimpleTimer timer = SimpleTimer.getInstance(context.getConfiguration());
 
     // We can use the same map for both metadata and normal assignments since the keyspace
(extent)
     // is guaranteed to be unique. Schedule the task once, the task will reschedule itself.
@@ -552,7 +553,7 @@ public class TabletServerResourceManager {
     MemoryManagementFramework() {
       tabletReports = Collections.synchronizedMap(new HashMap<>());
       memUsageReports = new LinkedBlockingQueue<>();
-      maxMem = conf.getSystemConfiguration().getAsBytes(Property.TSERV_MAXMEM);
+      maxMem = context.getConfiguration().getAsBytes(Property.TSERV_MAXMEM);
 
       Runnable r1 = new Runnable() {
         @Override
@@ -717,7 +718,7 @@ public class TabletServerResourceManager {
   void waitUntilCommitsAreEnabled() {
     if (holdCommits) {
       long timeout = System.currentTimeMillis()
-          + conf.getSystemConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT);
+          + context.getConfiguration().getTimeInMillis(Property.GENERAL_RPC_TIMEOUT);
       synchronized (commitHold) {
         while (holdCommits) {
           try {
diff --git a/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerResourceManagerDynamicCompactionPoolTest.java
b/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerResourceManagerDynamicCompactionPoolTest.java
new file mode 100644
index 0000000..10530ac
--- /dev/null
+++ b/server/tserver/src/test/java/org/apache/accumulo/tserver/TabletServerResourceManagerDynamicCompactionPoolTest.java
@@ -0,0 +1,159 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.tserver;
+
+import static org.apache.accumulo.fate.util.UtilWaitThread.sleep;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertTrue;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.apache.accumulo.core.conf.ConfigurationCopy;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.TableId;
+import org.apache.accumulo.core.dataImpl.KeyExtent;
+import org.apache.accumulo.server.ServerContext;
+import org.apache.accumulo.server.conf.ServerConfigurationFactory;
+import org.junit.After;
+import org.junit.Test;
+
+public class TabletServerResourceManagerDynamicCompactionPoolTest {
+
+  private final AtomicBoolean keepRunning = new AtomicBoolean(true);
+  private final AtomicInteger numRunning = new AtomicInteger(0);
+  private final AtomicInteger maxRan = new AtomicInteger(0);
+
+  private class FakeCompaction implements Runnable, Comparable<Runnable> {
+    private final TableId id;
+
+    public FakeCompaction(TableId id) {
+      this.id = id;
+    }
+
+    @Override
+    public void run() {
+      numRunning.addAndGet(1);
+      while (keepRunning.get()) {
+        sleep(5);
+      }
+      numRunning.decrementAndGet();
+      maxRan.addAndGet(1);
+    }
+
+    @Override
+    public int compareTo(Runnable o) {
+      if (o instanceof FakeCompaction) {
+        return id.canonical().compareTo(((FakeCompaction) o).id.canonical());
+      }
+      return 1;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+      return super.equals(obj);
+    }
+
+    @Override
+    public int hashCode() {
+      return super.hashCode();
+    }
+  }
+
+  @After
+  public void stopRunningThreads() {
+    keepRunning.set(false);
+  }
+
+  /*
+   * Ensure the TabletServerResourceManager increases the thread pool size dynamically
+   */
+  @Test(timeout = 20_000)
+  public void testDynamicThreadPoolUpdates() {
+    // create a mock config that substitutes for the system configuration in ZK
+    ConfigurationCopy config = new ConfigurationCopy(DefaultConfiguration.getInstance())
{
+      @Override
+      public boolean isPropertySet(Property prop, boolean cacheAndWatch) {
+        return false;
+      }
+    };
+    config.set(Property.TSERV_NATIVEMAP_ENABLED, "false");
+    config.set(Property.TSERV_MAJC_DELAY, "100ms");
+    config.set(Property.TSERV_MAJC_MAXCONCURRENT, "3");
+
+    ServerConfigurationFactory serverConfFactory = createMock(ServerConfigurationFactory.class);
+    expect(serverConfFactory.getSystemConfiguration()).andReturn(config).anyTimes();
+    ServerContext context = createMock(ServerContext.class);
+    expect(context.getConfiguration()).andReturn(config).anyTimes();
+    expect(context.getVolumeManager()).andReturn(null).anyTimes();
+    expect(context.getServerConfFactory()).andReturn(serverConfFactory).anyTimes();
+    replay(context, serverConfFactory);
+
+    // create a resource manager to test
+    keepRunning.set(true);
+    TabletServerResourceManager manager = new TabletServerResourceManager(context);
+
+    // start first batch and ensure it runs at most 3 at a time (initial configuration)
+    for (int i = 0; i < 10; i++) {
+      TableId id = TableId.of("userTableBatch1_" + i);
+      manager.executeMajorCompaction(new KeyExtent(id, null, null), new FakeCompaction(id));
+    }
+    waitForNumRunningToReach(3);
+
+    // increase the number of concurrent threads to 5 and wait for it to eventually reach
5
+    config.set(Property.TSERV_MAJC_MAXCONCURRENT, "5");
+    waitForNumRunningToReach(5);
+
+    // shut down the first batch (this will run all the remaining queued)
+    keepRunning.set(false);
+    waitForNumRunningToReach(0);
+
+    // make sure all 10 in the first batch ran, and reset it for the second batch
+    assertTrue(maxRan.compareAndSet(10, 0));
+
+    // decrease to 2, but need to wait for it to propagate, or else the running compactions
will
+    // block the decrease in the threadpool size; the scheduler updates this every 10 seconds,
so
+    // we'll give it 12 to be sure it updated before we execute any new tasks
+    config.set(Property.TSERV_MAJC_MAXCONCURRENT, "2");
+    sleep(12_000);
+
+    // start the second batch of 10 tasks, and make sure it stops at 2
+    keepRunning.set(true);
+    for (int i = 0; i < 10; i++) {
+      TableId id = TableId.of("userTableBatch2_" + i);
+      manager.executeMajorCompaction(new KeyExtent(id, null, null), new FakeCompaction(id));
+    }
+    waitForNumRunningToReach(2);
+
+    // shut down second batch (this will run out all the remaining queued)
+    keepRunning.set(false);
+    waitForNumRunningToReach(0);
+
+    // make sure all 10 in the second batch ran, and reset it
+    assertTrue(maxRan.compareAndSet(10, 0));
+  }
+
+  private void waitForNumRunningToReach(int expected) {
+    while (numRunning.get() != expected) {
+      sleep(10);
+    }
+  }
+
+}
diff --git a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
index a5a13cd..d730049 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -834,8 +834,8 @@ public class ShellServerIT extends SharedMiniClusterBase {
   @Test
   public void classpath() throws Exception {
     // classpath
-    ts.exec("classpath", true, "Level 2: Java Classloader (loads everything"
-        + " defined by java classpath) URL classpath items are", true);
+    ts.exec("classpath", true,
+        "Level 2: Java Classloader (loads everything" + " defined by java classpath)", true);
   }
 
   @Test
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
deleted file mode 100644
index 0b94928..0000000
--- a/test/src/main/java/org/apache/accumulo/test/functional/DynamicThreadPoolsIT.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.accumulo.test.functional;
-
-import static org.apache.accumulo.fate.util.UtilWaitThread.sleepUninterruptibly;
-import static org.junit.Assert.fail;
-
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.accumulo.core.client.Accumulo;
-import org.apache.accumulo.core.client.AccumuloClient;
-import org.apache.accumulo.core.clientImpl.ClientContext;
-import org.apache.accumulo.core.clientImpl.Credentials;
-import org.apache.accumulo.core.clientImpl.MasterClient;
-import org.apache.accumulo.core.clientImpl.thrift.ThriftNotActiveServiceException;
-import org.apache.accumulo.core.conf.ConfigurationTypeHelper;
-import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.master.thrift.MasterClientService;
-import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
-import org.apache.accumulo.core.master.thrift.TableInfo;
-import org.apache.accumulo.core.master.thrift.TabletServerStatus;
-import org.apache.accumulo.core.trace.TraceUtil;
-import org.apache.accumulo.harness.AccumuloClusterHarness;
-import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
-import org.apache.accumulo.test.TestIngest;
-import org.apache.accumulo.test.TestIngest.IngestParams;
-import org.apache.hadoop.conf.Configuration;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class DynamicThreadPoolsIT extends AccumuloClusterHarness {
-
-  @Override
-  public void configureMiniCluster(MiniAccumuloConfigImpl cfg, Configuration hadoopCoreSite)
{
-    cfg.setNumTservers(1);
-    Map<String,String> siteConfig = cfg.getSiteConfig();
-    siteConfig.put(Property.TSERV_MAJC_DELAY.getKey(), "100ms");
-    cfg.setSiteConfig(siteConfig);
-  }
-
-  @Override
-  protected int defaultTimeoutSeconds() {
-    return 4 * 60;
-  }
-
-  private String majcDelay;
-
-  @Before
-  public void updateMajcDelay() throws Exception {
-    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
-      majcDelay =
-          c.instanceOperations().getSystemConfiguration().get(Property.TSERV_MAJC_DELAY.getKey());
-      c.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), "100ms");
-      if (getClusterType() == ClusterType.STANDALONE) {
-        Thread.sleep(ConfigurationTypeHelper.getTimeInMillis(majcDelay));
-      }
-    }
-  }
-
-  @After
-  public void resetMajcDelay() throws Exception {
-    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
-      c.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), majcDelay);
-    }
-  }
-
-  @Test
-  public void test() throws Exception {
-    final String[] tables = getUniqueNames(15);
-    String firstTable = tables[0];
-    try (AccumuloClient c = Accumulo.newClient().from(getClientProps()).build()) {
-      c.instanceOperations().setProperty(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), "5");
-      IngestParams params = new IngestParams(getClientProps(), firstTable, 500_000);
-      params.createTable = true;
-      TestIngest.ingest(c, params);
-      c.tableOperations().flush(firstTable, null, null, true);
-      for (int i = 1; i < tables.length; i++)
-        c.tableOperations().clone(firstTable, tables[i], true, null, null);
-      sleepUninterruptibly(11, TimeUnit.SECONDS); // time between checks of the thread pool
sizes
-      Credentials creds = new Credentials(getAdminPrincipal(), getAdminToken());
-      for (int i = 1; i < tables.length; i++)
-        c.tableOperations().compact(tables[i], null, null, true, false);
-      for (int i = 0; i < 30; i++) {
-        int count = 0;
-        MasterClientService.Iface client = null;
-        MasterMonitorInfo stats = null;
-        while (true) {
-          try {
-            client = MasterClient.getConnectionWithRetry((ClientContext) c);
-            stats = client.getMasterStats(TraceUtil.traceInfo(),
-                creds.toThrift(c.instanceOperations().getInstanceID()));
-            break;
-          } catch (ThriftNotActiveServiceException e) {
-            // Let it loop, fetching a new location
-            sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
-          } finally {
-            if (client != null)
-              MasterClient.close(client);
-          }
-        }
-        for (TabletServerStatus server : stats.tServerInfo) {
-          for (TableInfo table : server.tableMap.values()) {
-            count += table.majors.running;
-          }
-        }
-        System.out.println("count " + count);
-        if (count > 3)
-          return;
-        sleepUninterruptibly(500, TimeUnit.MILLISECONDS);
-      }
-      fail("Could not observe higher number of threads after changing the config");
-    }
-  }
-}
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
index b29d6a3..1856efb 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/GarbageCollectorIT.java
@@ -102,7 +102,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
     try {
       ZooLock.deleteLock(zk, path);
     } catch (IllegalStateException e) {
-
+      log.error("Unable to delete ZooLock for mini accumulo-gc", e);
     }
 
     assertNull(getCluster().getProcesses().get(ServerType.GARBAGE_COLLECTOR));
@@ -144,7 +144,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
     log.info("Filling metadata table with bogus delete flags");
     try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
       addEntries(c);
-      cluster.getConfig().setDefaultMemory(10, MemoryUnit.MEGABYTE);
+      cluster.getConfig().setDefaultMemory(16, MemoryUnit.MEGABYTE);
       ProcessInfo gc = cluster.exec(SimpleGarbageCollector.class);
       sleepUninterruptibly(20, TimeUnit.SECONDS);
       String output = "";
@@ -152,6 +152,7 @@ public class GarbageCollectorIT extends ConfigurableMacBase {
         try {
           output = gc.readStdOut();
         } catch (UncheckedIOException ex) {
+          log.error("IO error reading the IT's accumulo-gc STDOUT", ex);
           break;
         }
       }


Mime
View raw message