You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by md...@apache.org on 2015/07/07 10:14:31 UTC

svn commit: r1689595 - /jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentCompactionIT.java

Author: mduerig
Date: Tue Jul  7 08:14:31 2015
New Revision: 1689595

URL: http://svn.apache.org/r1689595
Log:
OAK-2849: Improve revision gc on SegmentMK
SegmentCompactionIT improvement: configurable core pool size

Modified:
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentCompactionIT.java

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentCompactionIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentCompactionIT.java?rev=1689595&r1=1689594&r2=1689595&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentCompactionIT.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/segment/SegmentCompactionIT.java Tue Jul  7 08:14:31 2015
@@ -28,7 +28,6 @@ import static com.google.common.util.con
 import static java.io.File.createTempFile;
 import static java.lang.String.valueOf;
 import static java.lang.System.getProperty;
-import static java.util.concurrent.Executors.newScheduledThreadPool;
 import static java.util.concurrent.TimeUnit.MINUTES;
 import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.apache.commons.io.FileUtils.deleteDirectory;
@@ -53,6 +52,7 @@ import java.util.Random;
 import java.util.Set;
 import java.util.concurrent.Callable;
 import java.util.concurrent.CancellationException;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
 
 import javax.annotation.Nonnull;
 import javax.management.InstanceAlreadyExistsException;
@@ -110,8 +110,8 @@ public class SegmentCompactionIT {
     private final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
 
     private final Random rnd = new Random();
-    private final ListeningScheduledExecutorService scheduler =
-            listeningDecorator(newScheduledThreadPool(50));
+    private final ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(50);
+    private final ListeningScheduledExecutorService scheduler = listeningDecorator(executor);
     private final FileStoreGCMonitor fileStoreGCMonitor = new FileStoreGCMonitor(Clock.SIMPLE);
     private final TestGCMonitor gcMonitor = new TestGCMonitor(fileStoreGCMonitor);
     private final Set<ListenableScheduledFuture<?>> writers = newConcurrentHashSet();
@@ -611,6 +611,14 @@ public class SegmentCompactionIT {
             SegmentCompactionIT.this.stop();
         }
 
+        public void setCorePoolSize(int corePoolSize) {
+            executor.setCorePoolSize(corePoolSize);
+        }
+
+        public int getCorePoolSize() {
+            return executor.getCorePoolSize();
+        }
+
         @Override
         public void setCompactionInterval(int minutes) {
             if (compactionInterval != minutes) {