|
@@ -22,6 +22,8 @@ import org.elasticsearch.search.aggregations.Aggregations;
|
|
|
import org.elasticsearch.search.aggregations.InternalAggregations;
|
|
|
import org.elasticsearch.search.aggregations.bucket.composite.CompositeAggregation;
|
|
|
import org.elasticsearch.test.ESTestCase;
|
|
|
+import org.elasticsearch.threadpool.TestThreadPool;
|
|
|
+import org.elasticsearch.threadpool.ThreadPool;
|
|
|
import org.elasticsearch.xpack.core.indexing.IndexerState;
|
|
|
import org.elasticsearch.xpack.core.rollup.ConfigTestHelpers;
|
|
|
import org.elasticsearch.xpack.core.rollup.RollupField;
|
|
@@ -35,9 +37,7 @@ import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
-import java.util.concurrent.Executor;
|
|
|
-import java.util.concurrent.ExecutorService;
|
|
|
-import java.util.concurrent.Executors;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
import java.util.function.BiConsumer;
|
|
@@ -52,14 +52,14 @@ import static org.mockito.Mockito.spy;
|
|
|
|
|
|
public class RollupIndexerStateTests extends ESTestCase {
|
|
|
private static class EmptyRollupIndexer extends RollupIndexer {
|
|
|
- EmptyRollupIndexer(Executor executor, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
+ EmptyRollupIndexer(ThreadPool threadPool, String executorName, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
Map<String, Object> initialPosition, RollupIndexerJobStats stats) {
|
|
|
- super(executor, job, initialState, initialPosition, stats);
|
|
|
+ super(threadPool, executorName, job, initialState, initialPosition, stats);
|
|
|
}
|
|
|
|
|
|
- EmptyRollupIndexer(Executor executor, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
+ EmptyRollupIndexer(ThreadPool threadPool, String executorName, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
Map<String, Object> initialPosition) {
|
|
|
- super(executor, job, initialState, initialPosition);
|
|
|
+ super(threadPool, executorName, job, initialState, initialPosition);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -134,14 +134,14 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
private static class DelayedEmptyRollupIndexer extends EmptyRollupIndexer {
|
|
|
protected CountDownLatch latch;
|
|
|
|
|
|
- DelayedEmptyRollupIndexer(Executor executor, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
+ DelayedEmptyRollupIndexer(ThreadPool threadPool, String executorName, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
Map<String, Object> initialPosition) {
|
|
|
- super(executor, job, initialState, initialPosition);
|
|
|
+ super(threadPool, executorName, job, initialState, initialPosition);
|
|
|
}
|
|
|
|
|
|
- DelayedEmptyRollupIndexer(Executor executor, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
+ DelayedEmptyRollupIndexer(ThreadPool threadPool, String executorName, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
Map<String, Object> initialPosition, RollupIndexerJobStats stats) {
|
|
|
- super(executor, job, initialState, initialPosition, stats);
|
|
|
+ super(threadPool, executorName, job, initialState, initialPosition, stats);
|
|
|
}
|
|
|
|
|
|
private CountDownLatch newLatch() {
|
|
@@ -167,17 +167,17 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
final BiConsumer<IndexerState, Map<String, Object>> saveStateCheck;
|
|
|
private CountDownLatch latch;
|
|
|
|
|
|
- NonEmptyRollupIndexer(Executor executor, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
+ NonEmptyRollupIndexer(ThreadPool threadPool, String executorName, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
Map<String, Object> initialPosition, Function<SearchRequest, SearchResponse> searchFunction,
|
|
|
Function<BulkRequest, BulkResponse> bulkFunction, Consumer<Exception> failureConsumer) {
|
|
|
- this(executor, job, initialState, initialPosition, searchFunction, bulkFunction, failureConsumer, (i, m) -> {});
|
|
|
+ this(threadPool, executorName, job, initialState, initialPosition, searchFunction, bulkFunction, failureConsumer, (i, m) -> {});
|
|
|
}
|
|
|
|
|
|
- NonEmptyRollupIndexer(Executor executor, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
+ NonEmptyRollupIndexer(ThreadPool threadPool, String executorName, RollupJob job, AtomicReference<IndexerState> initialState,
|
|
|
Map<String, Object> initialPosition, Function<SearchRequest, SearchResponse> searchFunction,
|
|
|
Function<BulkRequest, BulkResponse> bulkFunction, Consumer<Exception> failureConsumer,
|
|
|
BiConsumer<IndexerState, Map<String, Object>> saveStateCheck) {
|
|
|
- super(executor, job, initialState, initialPosition);
|
|
|
+ super(threadPool, executorName, job, initialState, initialPosition);
|
|
|
this.searchFunction = searchFunction;
|
|
|
this.bulkFunction = bulkFunction;
|
|
|
this.failureConsumer = failureConsumer;
|
|
@@ -242,9 +242,9 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
public void testStarted() throws Exception {
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
- RollupIndexer indexer = new EmptyRollupIndexer(executor, job, state, null);
|
|
|
+ RollupIndexer indexer = new EmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null);
|
|
|
indexer.start();
|
|
|
assertThat(indexer.getState(), equalTo(IndexerState.STARTED));
|
|
|
assertTrue(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
|
|
@@ -257,17 +257,17 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getIndexTotal(), equalTo(0L));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void testIndexing() throws Exception {
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
AtomicBoolean isFinished = new AtomicBoolean(false);
|
|
|
- DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(executor, job, state, null) {
|
|
|
+ DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null) {
|
|
|
@Override
|
|
|
protected void onFinish(ActionListener<Void> listener) {
|
|
|
super.onFinish(ActionListener.wrap(r -> {
|
|
@@ -300,7 +300,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getSearchTotal(), equalTo(1L));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -322,10 +322,11 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
doAnswer(forwardAndChangeState).when(spyStats).incrementNumInvocations(1L);
|
|
|
RollupJob job = new RollupJob(config, Collections.emptyMap());
|
|
|
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
AtomicBoolean isFinished = new AtomicBoolean(false);
|
|
|
- DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(executor, job, state, null, spyStats) {
|
|
|
+ DelayedEmptyRollupIndexer indexer =
|
|
|
+ new DelayedEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null, spyStats) {
|
|
|
@Override
|
|
|
protected void onFinish(ActionListener<Void> listener) {
|
|
|
super.onFinish(ActionListener.wrap(r -> {
|
|
@@ -345,7 +346,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getNumPages(), equalTo(0L));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -353,10 +354,10 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
final AtomicBoolean aborted = new AtomicBoolean(false);
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
final CountDownLatch latch = new CountDownLatch(1);
|
|
|
try {
|
|
|
- EmptyRollupIndexer indexer = new EmptyRollupIndexer(executor, job, state, null) {
|
|
|
+ EmptyRollupIndexer indexer = new EmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null) {
|
|
|
@Override
|
|
|
protected void onFinish(ActionListener<Void> listener) {
|
|
|
fail("Should not have called onFinish");
|
|
@@ -390,7 +391,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getNumPages(), equalTo(0L));
|
|
|
assertThat(indexer.getStats().getSearchFailures(), equalTo(0L));
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -398,13 +399,13 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
final AtomicBoolean aborted = new AtomicBoolean(false);
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
|
|
|
// Don't use the indexer's latch because we completely change doNextSearch()
|
|
|
final CountDownLatch doNextSearchLatch = new CountDownLatch(1);
|
|
|
|
|
|
try {
|
|
|
- DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(executor, job, state, null) {
|
|
|
+ DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null) {
|
|
|
@Override
|
|
|
protected void onAbort() {
|
|
|
aborted.set(true);
|
|
@@ -477,16 +478,16 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getNumInvocations(), equalTo(1L));
|
|
|
assertThat(indexer.getStats().getNumPages(), equalTo(1L));
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void testStopIndexing() throws Exception {
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
- DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(executor, job, state, null);
|
|
|
+ DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null);
|
|
|
final CountDownLatch latch = indexer.newLatch();
|
|
|
assertFalse(indexer.maybeTriggerAsyncJob(System.currentTimeMillis()));
|
|
|
assertThat(indexer.getState(), equalTo(IndexerState.STOPPED));
|
|
@@ -499,17 +500,17 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertBusy(() -> assertThat(indexer.getState(), equalTo(IndexerState.STOPPED)));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void testAbortIndexing() throws Exception {
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
final AtomicBoolean isAborted = new AtomicBoolean(false);
|
|
|
- DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(executor, job, state, null) {
|
|
|
+ DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null) {
|
|
|
@Override
|
|
|
protected void onAbort() {
|
|
|
isAborted.set(true);
|
|
@@ -526,17 +527,17 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertBusy(() -> assertTrue(isAborted.get()));
|
|
|
assertFalse(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void testAbortStarted() {
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
final AtomicBoolean isAborted = new AtomicBoolean(false);
|
|
|
- DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(executor, job, state, null) {
|
|
|
+ DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null) {
|
|
|
@Override
|
|
|
protected void onAbort() {
|
|
|
isAborted.set(true);
|
|
@@ -552,17 +553,17 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getNumPages(), equalTo(0L));
|
|
|
assertFalse(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
public void testMultipleJobTriggering() throws Exception {
|
|
|
RollupJob job = new RollupJob(ConfigTestHelpers.randomRollupJobConfig(random()), Collections.emptyMap());
|
|
|
AtomicReference<IndexerState> state = new AtomicReference<>(IndexerState.STOPPED);
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
final AtomicBoolean isAborted = new AtomicBoolean(false);
|
|
|
- DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(executor, job, state, null) {
|
|
|
+ DelayedEmptyRollupIndexer indexer = new DelayedEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null) {
|
|
|
@Override
|
|
|
protected void onAbort() {
|
|
|
isAborted.set(true);
|
|
@@ -589,7 +590,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertBusy(() -> assertThat(indexer.getState(), equalTo(IndexerState.STOPPED)));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -676,10 +677,10 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
|
|
|
- NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(executor, job, state, null,
|
|
|
+ NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null,
|
|
|
searchFunction, bulkFunction, failureConsumer, stateCheck);
|
|
|
final CountDownLatch latch = indexer.newLatch(1);
|
|
|
indexer.start();
|
|
@@ -701,7 +702,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getOutputDocuments(), equalTo(0L));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -788,10 +789,10 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
isFinished.set(true);
|
|
|
};
|
|
|
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
|
|
|
- NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(executor, job, state, null,
|
|
|
+ NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null,
|
|
|
searchFunction, bulkFunction, failureConsumer, doSaveStateCheck);
|
|
|
final CountDownLatch latch = indexer.newLatch(1);
|
|
|
indexer.start();
|
|
@@ -812,7 +813,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getOutputDocuments(), equalTo(0L));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -836,10 +837,10 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
|
|
|
- NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(executor, job, state, null,
|
|
|
+ NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null,
|
|
|
searchFunction, bulkFunction, failureConsumer, stateCheck);
|
|
|
final CountDownLatch latch = indexer.newLatch(1);
|
|
|
indexer.start();
|
|
@@ -861,7 +862,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getOutputDocuments(), equalTo(0L));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -949,10 +950,10 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- final ExecutorService executor = Executors.newFixedThreadPool(1);
|
|
|
+ final ThreadPool threadPool = new TestThreadPool(getTestName());
|
|
|
try {
|
|
|
|
|
|
- NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(executor, job, state, null,
|
|
|
+ NonEmptyRollupIndexer indexer = new NonEmptyRollupIndexer(threadPool, ThreadPool.Names.GENERIC, job, state, null,
|
|
|
searchFunction, bulkFunction, failureConsumer, stateCheck) {
|
|
|
@Override
|
|
|
protected void doNextBulk(BulkRequest request, ActionListener<BulkResponse> nextPhase) {
|
|
@@ -979,7 +980,7 @@ public class RollupIndexerStateTests extends ESTestCase {
|
|
|
assertThat(indexer.getStats().getOutputDocuments(), equalTo(0L));
|
|
|
assertTrue(indexer.abort());
|
|
|
} finally {
|
|
|
- executor.shutdownNow();
|
|
|
+ ThreadPool.terminate(threadPool, 30, TimeUnit.SECONDS);
|
|
|
}
|
|
|
}
|
|
|
}
|