mirror of
https://gitee.com/BDWare/agent-backend
synced 2025-01-09 17:34:13 +00:00
feat: update SelfAdaptiveSharding
use independent thread pool to handle messages;ignore body validation
This commit is contained in:
parent
ed507b14b4
commit
87d32ab220
@ -20,10 +20,7 @@ import org.bdware.server.action.CMActions;
|
||||
import org.bdware.units.NetworkManager;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -48,12 +45,12 @@ public class SelfAdaptiveShardingExecutor implements ContractExecutor {
|
||||
|
||||
public SelfAdaptiveShardingExecutor(String contractID) {
|
||||
this.meta = CMActions.manager.multiContractRecorder.getMultiContractMeta(contractID);
|
||||
this.future = ContractManager.scheduledThreadPool.scheduleWithFixedDelay(
|
||||
this.future = Executors.newScheduledThreadPool(1).scheduleWithFixedDelay(
|
||||
this::submitBlock,
|
||||
DELAY,
|
||||
DELAY,
|
||||
TimeUnit.SECONDS);
|
||||
ContractManager.threadPool.execute(() -> {
|
||||
Executors.newCachedThreadPool().execute(() -> {
|
||||
LOGGER.info(String.format(
|
||||
"[Executor %s] starting executing service... %b",
|
||||
meta.getContractID(), meta.isMaster()));
|
||||
|
Loading…
Reference in New Issue
Block a user