Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
81b559b787
4 changed files with 14 additions and 8 deletions
|
|
@ -47,6 +47,7 @@ public class ClearingService implements DisposableBean {
|
|||
|
||||
@Override
|
||||
public void destroy() throws Exception {
|
||||
log.debug("Shutdown {}", getClass().getSimpleName());
|
||||
executor.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ import ru.spcex.platform.imdg.api.ImdgProvider;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
|
|||
|
|
@ -83,16 +83,20 @@ public abstract class AbstractHazelcastLifecycleSupport implements InitializingB
|
|||
return maxKey;
|
||||
});
|
||||
}
|
||||
long maxKey = 0L;
|
||||
int threadCount = Runtime.getRuntime().availableProcessors();// todo config * Config.get().getRoot().getSettings().getInitHazelcastThreadMultiplier();
|
||||
log.info("Initializing threads count = {}", threadCount);
|
||||
ExecutorService executor = Executors.newWorkStealingPool(threadCount);
|
||||
List<Future<Long>> results = executor.invokeAll(tasks);
|
||||
long maxKey = 0L;
|
||||
for (Future<Long> result : results) {
|
||||
Long maxKeyResult = result.get();
|
||||
if (maxKeyResult != null) {
|
||||
maxKey = Math.max(maxKey, maxKeyResult);
|
||||
try {
|
||||
List<Future<Long>> results = executor.invokeAll(tasks);
|
||||
for (Future<Long> result : results) {
|
||||
Long maxKeyResult = result.get();
|
||||
if (maxKeyResult != null) {
|
||||
maxKey = Math.max(maxKey, maxKeyResult);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
executor.shutdown();
|
||||
}
|
||||
|
||||
IdGenerator generator = hazelcastServerInstance.getIdGenerator(IMDGDistributedNames.MAP_SEQUENCE_NAME);
|
||||
|
|
|
|||
|
|
@ -157,8 +157,11 @@ public class QueueConsumer implements AutoCloseable {
|
|||
|
||||
@Override
|
||||
public void close() {
|
||||
log.debug("Closing queue consumer {}", getClass().getSimpleName());
|
||||
closed.set(true);
|
||||
consumer.wakeup();
|
||||
inputExecutor.shutdown();
|
||||
outputExecutor.shutdown();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue