changing FlowRuleManager from cached threadpool to fixed thread pool
Change-Id: Ie24dae672e699447b55411bf3492efa96e2e16c2
Showing
1 changed file
with
20 additions
and
21 deletions
... | @@ -15,15 +15,12 @@ | ... | @@ -15,15 +15,12 @@ |
15 | */ | 15 | */ |
16 | package org.onosproject.net.flow.impl; | 16 | package org.onosproject.net.flow.impl; |
17 | 17 | ||
18 | -import java.util.Collections; | 18 | +import com.google.common.collect.ArrayListMultimap; |
19 | -import java.util.List; | 19 | +import com.google.common.collect.Iterables; |
20 | -import java.util.Map; | 20 | +import com.google.common.collect.Lists; |
21 | -import java.util.Set; | 21 | +import com.google.common.collect.Maps; |
22 | -import java.util.concurrent.ConcurrentHashMap; | 22 | +import com.google.common.collect.Multimap; |
23 | -import java.util.concurrent.ExecutorService; | 23 | +import com.google.common.collect.Sets; |
24 | -import java.util.concurrent.Executors; | ||
25 | -import java.util.concurrent.atomic.AtomicBoolean; | ||
26 | - | ||
27 | import org.apache.felix.scr.annotations.Activate; | 24 | import org.apache.felix.scr.annotations.Activate; |
28 | import org.apache.felix.scr.annotations.Component; | 25 | import org.apache.felix.scr.annotations.Component; |
29 | import org.apache.felix.scr.annotations.Deactivate; | 26 | import org.apache.felix.scr.annotations.Deactivate; |
... | @@ -60,21 +57,23 @@ import org.onosproject.net.provider.AbstractProviderRegistry; | ... | @@ -60,21 +57,23 @@ import org.onosproject.net.provider.AbstractProviderRegistry; |
60 | import org.onosproject.net.provider.AbstractProviderService; | 57 | import org.onosproject.net.provider.AbstractProviderService; |
61 | import org.slf4j.Logger; | 58 | import org.slf4j.Logger; |
62 | 59 | ||
63 | -import com.google.common.collect.ArrayListMultimap; | 60 | +import java.util.Collections; |
64 | -import com.google.common.collect.Iterables; | 61 | +import java.util.List; |
65 | -import com.google.common.collect.Lists; | 62 | +import java.util.Map; |
66 | -import com.google.common.collect.Maps; | 63 | +import java.util.Set; |
67 | -import com.google.common.collect.Multimap; | 64 | +import java.util.concurrent.ConcurrentHashMap; |
68 | -import com.google.common.collect.Sets; | 65 | +import java.util.concurrent.ExecutorService; |
66 | +import java.util.concurrent.Executors; | ||
67 | +import java.util.concurrent.atomic.AtomicBoolean; | ||
69 | 68 | ||
70 | import static com.google.common.base.Preconditions.checkNotNull; | 69 | import static com.google.common.base.Preconditions.checkNotNull; |
71 | -import static org.onlab.util.Tools.namedThreads; | 70 | +import static org.onlab.util.Tools.groupedThreads; |
72 | import static org.slf4j.LoggerFactory.getLogger; | 71 | import static org.slf4j.LoggerFactory.getLogger; |
73 | 72 | ||
74 | /** | 73 | /** |
75 | * Provides implementation of the flow NB & SB APIs. | 74 | * Provides implementation of the flow NB & SB APIs. |
76 | */ | 75 | */ |
77 | -@Component(immediate = true) | 76 | +@Component(immediate = true, enabled = true) |
78 | @Service | 77 | @Service |
79 | public class FlowRuleManager | 78 | public class FlowRuleManager |
80 | extends AbstractProviderRegistry<FlowRuleProvider, FlowRuleProviderService> | 79 | extends AbstractProviderRegistry<FlowRuleProvider, FlowRuleProviderService> |
... | @@ -91,15 +90,15 @@ public class FlowRuleManager | ... | @@ -91,15 +90,15 @@ public class FlowRuleManager |
91 | private final FlowRuleStoreDelegate delegate = new InternalStoreDelegate(); | 90 | private final FlowRuleStoreDelegate delegate = new InternalStoreDelegate(); |
92 | 91 | ||
93 | protected ExecutorService deviceInstallers = | 92 | protected ExecutorService deviceInstallers = |
94 | - Executors.newCachedThreadPool(namedThreads("onos-device-installer-%d")); | 93 | + Executors.newFixedThreadPool(32, groupedThreads("onos/flowservice", "device-installer-%d")); |
95 | 94 | ||
96 | protected ExecutorService operationsService = | 95 | protected ExecutorService operationsService = |
97 | - Executors.newFixedThreadPool(32, namedThreads("onos-flowservice-operations-%d")); | 96 | + Executors.newFixedThreadPool(32, groupedThreads("onos/flowservice", "operations-%d")); |
98 | 97 | ||
99 | private IdGenerator idGenerator; | 98 | private IdGenerator idGenerator; |
100 | 99 | ||
101 | - private Map<Long, FlowOperationsProcessor> pendingFlowOperations = new | 100 | + private Map<Long, FlowOperationsProcessor> pendingFlowOperations |
102 | - ConcurrentHashMap<>(); | 101 | + = new ConcurrentHashMap<>(); |
103 | 102 | ||
104 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 103 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
105 | protected FlowRuleStore store; | 104 | protected FlowRuleStore store; | ... | ... |
-
Please register or login to post a comment