EventuallyConsistentMap: changing to groupedThreads
Change-Id: Ie57afcc1013fa33172bf51f73980171d8ea3df29
Showing
1 changed file
with
4 additions
and
4 deletions
... | @@ -52,8 +52,8 @@ import java.util.stream.Collectors; | ... | @@ -52,8 +52,8 @@ import java.util.stream.Collectors; |
52 | import static com.google.common.base.Preconditions.checkNotNull; | 52 | import static com.google.common.base.Preconditions.checkNotNull; |
53 | import static com.google.common.base.Preconditions.checkState; | 53 | import static com.google.common.base.Preconditions.checkState; |
54 | import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; | 54 | import static java.util.concurrent.Executors.newSingleThreadScheduledExecutor; |
55 | +import static org.onlab.util.Tools.groupedThreads; | ||
55 | import static org.onlab.util.Tools.minPriority; | 56 | import static org.onlab.util.Tools.minPriority; |
56 | -import static org.onlab.util.Tools.namedThreads; | ||
57 | 57 | ||
58 | /** | 58 | /** |
59 | * Distributed Map implementation which uses optimistic replication and gossip | 59 | * Distributed Map implementation which uses optimistic replication and gossip |
... | @@ -142,12 +142,12 @@ public class EventuallyConsistentMapImpl<K, V> | ... | @@ -142,12 +142,12 @@ public class EventuallyConsistentMapImpl<K, V> |
142 | items = new ConcurrentHashMap<>(); | 142 | items = new ConcurrentHashMap<>(); |
143 | removedItems = new ConcurrentHashMap<>(); | 143 | removedItems = new ConcurrentHashMap<>(); |
144 | 144 | ||
145 | - executor = Executors | 145 | + executor = Executors //FIXME |
146 | - .newCachedThreadPool(namedThreads("onos-ecm-" + mapName + "-fg-%d")); | 146 | + .newFixedThreadPool(4, groupedThreads("onos/ecm", mapName + "-fg-%d")); |
147 | 147 | ||
148 | backgroundExecutor = | 148 | backgroundExecutor = |
149 | newSingleThreadScheduledExecutor(minPriority( | 149 | newSingleThreadScheduledExecutor(minPriority( |
150 | - namedThreads("onos-ecm-" + mapName + "-bg-%d"))); | 150 | + groupedThreads("onos/ecm", mapName + "-bg-%d"))); |
151 | 151 | ||
152 | // start anti-entropy thread | 152 | // start anti-entropy thread |
153 | backgroundExecutor.scheduleAtFixedRate(new SendAdvertisementTask(), | 153 | backgroundExecutor.scheduleAtFixedRate(new SendAdvertisementTask(), | ... | ... |
-
Please register or login to post a comment