Bug 5214: Remove and replace DataMiningExceutorService with

ThreadPoolUtil background ThreadPoolExecutor
This commit is contained in:
Thomas Wiese
2020-07-28 17:15:25 +02:00
parent 0ae541c32a
commit 7de2f14586
5 changed files with 12 additions and 28 deletions
@@ -45,6 +45,7 @@ import com.sap.sse.datamining.shared.data.QueryResultState;
import com.sap.sse.datamining.shared.impl.GenericGroupKey;
import com.sap.sse.datamining.test.util.components.StatefulBlockingInstruction;
import com.sap.sse.datamining.test.util.components.StatefulProcessorInstruction;
import com.sap.sse.util.ThreadPoolUtil;
/**
* Integration test aborting a query with simulated heavy load instructions. Uses a highly customized processor chain
@@ -250,7 +251,8 @@ public class TestAbortingHeavyLoadQuery {
executionRecord = new ConcurrentLinkedQueue<>();
}
executor = new DataMiningExecutorService(ExecutorPoolSize);
executor = ThreadPoolUtil.INSTANCE
.createBackgroundTaskThreadPoolExecutor(ExecutorPoolSize, this.getClass().getName());
// executor = new ThreadPoolExecutor(ExecutorPoolSize, ExecutorPoolSize, 0, TimeUnit.MILLISECONDS, new PriorityBlockingQueue<>());
// executor = new ThreadPoolExecutor(ExecutorPoolSize, ExecutorPoolSize, 0, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
processors = new ArrayList<>();
@@ -11,13 +11,15 @@ import java.util.Map.Entry;
import java.util.concurrent.ExecutorService;
import com.sap.sse.datamining.components.Processor;
import com.sap.sse.datamining.impl.DataMiningExecutorService;
import com.sap.sse.datamining.shared.GroupKey;
import com.sap.sse.util.ThreadPoolUtil;
public class ConcurrencyTestsUtil extends TestsUtil {
private static final int THREAD_POOL_SIZE = Math.max(Runtime.getRuntime().availableProcessors(), 3);
private static final ExecutorService executor = new DataMiningExecutorService(THREAD_POOL_SIZE);
private static final ExecutorService executor = ThreadPoolUtil.INSTANCE
.createBackgroundTaskThreadPoolExecutor(THREAD_POOL_SIZE, ConcurrencyTestsUtil.class.getName());
public static ExecutorService getSharedExecutor() {
return executor;