mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-10-21 20:31:00 +02:00
properly reallocate thread pools after a restart
Change-Id: I08042acd75ebcb3ca16af189917c1fe6904f3afd
This commit is contained in:
parent
4910c4b676
commit
d1092d6583
@ -179,11 +179,8 @@ public class ECFlowRuleStore
|
|||||||
private ExecutorService messageHandlingExecutor;
|
private ExecutorService messageHandlingExecutor;
|
||||||
private ExecutorService eventHandler;
|
private ExecutorService eventHandler;
|
||||||
|
|
||||||
private final ScheduledExecutorService backupScheduler = Executors.newSingleThreadScheduledExecutor(
|
private ScheduledExecutorService backupScheduler;
|
||||||
groupedThreads("onos/flow", "backup-scheduler", log));
|
private ExecutorService backupExecutor;
|
||||||
private final ExecutorService backupExecutor = Executors.newFixedThreadPool(
|
|
||||||
max(min(Runtime.getRuntime().availableProcessors() * 2, 16), 4),
|
|
||||||
groupedThreads("onos/flow", "backup-%d", log));
|
|
||||||
|
|
||||||
private EventuallyConsistentMap<DeviceId, List<TableStatisticsEntry>> deviceTableStats;
|
private EventuallyConsistentMap<DeviceId, List<TableStatisticsEntry>> deviceTableStats;
|
||||||
private final EventuallyConsistentMapListener<DeviceId, List<TableStatisticsEntry>> tableStatsListener =
|
private final EventuallyConsistentMapListener<DeviceId, List<TableStatisticsEntry>> tableStatsListener =
|
||||||
@ -213,6 +210,12 @@ public class ECFlowRuleStore
|
|||||||
public void activate(ComponentContext context) {
|
public void activate(ComponentContext context) {
|
||||||
configService.registerProperties(getClass());
|
configService.registerProperties(getClass());
|
||||||
|
|
||||||
|
backupScheduler = Executors.newSingleThreadScheduledExecutor(
|
||||||
|
groupedThreads("onos/flow", "backup-scheduler", log));
|
||||||
|
backupExecutor = Executors.newFixedThreadPool(
|
||||||
|
max(min(Runtime.getRuntime().availableProcessors() * 2, 16), 4),
|
||||||
|
groupedThreads("onos/flow", "backup-%d", log));
|
||||||
|
|
||||||
idGenerator = coreService.getIdGenerator(FlowRuleService.FLOW_OP_TOPIC);
|
idGenerator = coreService.getIdGenerator(FlowRuleService.FLOW_OP_TOPIC);
|
||||||
|
|
||||||
local = clusterService.getLocalNode().id();
|
local = clusterService.getLocalNode().id();
|
||||||
@ -255,6 +258,8 @@ public class ECFlowRuleStore
|
|||||||
messageHandlingExecutor.shutdownNow();
|
messageHandlingExecutor.shutdownNow();
|
||||||
backupScheduler.shutdownNow();
|
backupScheduler.shutdownNow();
|
||||||
backupExecutor.shutdownNow();
|
backupExecutor.shutdownNow();
|
||||||
|
backupScheduler = null;
|
||||||
|
backupExecutor = null;
|
||||||
log.info("Stopped");
|
log.info("Stopped");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user