sanghoshin
Committed by Gerrit Code Review

[Falcon] SONA: creates a new thread for handling network config events

Change-Id: Ic972160fac19632e412095a6528544c59379010d
...@@ -97,6 +97,16 @@ ...@@ -97,6 +97,16 @@
97 <artifactId>jersey-client</artifactId> 97 <artifactId>jersey-client</artifactId>
98 <version>1.19</version> 98 <version>1.19</version>
99 </dependency> 99 </dependency>
100 + <dependency>
101 + <groupId>com.sun.jersey</groupId>
102 + <artifactId>jersey-core</artifactId>
103 + <version>1.19</version>
104 + </dependency>
105 + <dependency>
106 + <groupId>org.onosproject</groupId>
107 + <artifactId>onlab-misc</artifactId>
108 + <version>${project.version}</version>
109 + </dependency>
100 </dependencies> 110 </dependencies>
101 111
102 <build> 112 <build>
...@@ -126,7 +136,8 @@ ...@@ -126,7 +136,8 @@
126 org.apache.karaf.shell.commands, 136 org.apache.karaf.shell.commands,
127 com.google.common.*, 137 com.google.common.*,
128 org.onlab.packet.*, 138 org.onlab.packet.*,
129 - org.onosproject.* 139 + org.onosproject.*,
140 + org.onlab.util.*
130 </Import-Package> 141 </Import-Package>
131 <Web-ContextPath>${web.context}</Web-ContextPath> 142 <Web-ContextPath>${web.context}</Web-ContextPath>
132 </instructions> 143 </instructions>
......
...@@ -67,6 +67,7 @@ import java.util.concurrent.Executors; ...@@ -67,6 +67,7 @@ import java.util.concurrent.Executors;
67 import java.util.stream.Collectors; 67 import java.util.stream.Collectors;
68 68
69 import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY; 69 import static org.onosproject.net.config.basics.SubjectFactories.APP_SUBJECT_FACTORY;
70 +import static org.onlab.util.Tools.groupedThreads;
70 71
71 @SuppressWarnings("ALL") 72 @SuppressWarnings("ALL")
72 @Service 73 @Service
...@@ -103,6 +104,7 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService { ...@@ -103,6 +104,7 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService {
103 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 104 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
104 protected DriverService driverService; 105 protected DriverService driverService;
105 106
107 + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
106 protected FlowRuleService flowRuleService; 108 protected FlowRuleService flowRuleService;
107 109
108 private ApplicationId appId; 110 private ApplicationId appId;
...@@ -114,7 +116,10 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService { ...@@ -114,7 +116,10 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService {
114 private OpenstackArpHandler arpHandler; 116 private OpenstackArpHandler arpHandler;
115 private OpenstackRestHandler restHandler; 117 private OpenstackRestHandler restHandler;
116 118
117 - private ExecutorService deviceEventExcutorService = Executors.newFixedThreadPool(10); 119 + private ExecutorService deviceEventExcutorService =
120 + Executors.newSingleThreadExecutor(groupedThreads("onos/openstackswitching", "device-event"));
121 + private ExecutorService networkEventExcutorService =
122 + Executors.newSingleThreadExecutor(groupedThreads("onos/openstackswitching", "config-event"));
118 123
119 private InternalPacketProcessor internalPacketProcessor = new InternalPacketProcessor(); 124 private InternalPacketProcessor internalPacketProcessor = new InternalPacketProcessor();
120 private InternalDeviceListener internalDeviceListener = new InternalDeviceListener(); 125 private InternalDeviceListener internalDeviceListener = new InternalDeviceListener();
...@@ -492,7 +497,7 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService { ...@@ -492,7 +497,7 @@ public class OpenstackSwitchingManager implements OpenstackSwitchingService {
492 if (((event.type() == NetworkConfigEvent.Type.CONFIG_ADDED || 497 if (((event.type() == NetworkConfigEvent.Type.CONFIG_ADDED ||
493 event.type() == NetworkConfigEvent.Type.CONFIG_UPDATED)) && 498 event.type() == NetworkConfigEvent.Type.CONFIG_UPDATED)) &&
494 event.configClass().equals(OpenstackSwitchingConfig.class)) { 499 event.configClass().equals(OpenstackSwitchingConfig.class)) {
495 - configureNetwork(); 500 + networkEventExcutorService.execute(this::configureNetwork);
496 } 501 }
497 } 502 }
498 503
......