Make affinity data structures serializable, cloneable. 57/4057/1
authorSuchi Raman <suchi.raman@plexxi.com>
Tue, 7 Jan 2014 21:23:25 +0000 (16:23 -0500)
committerSuchi Raman <suchi.raman@plexxi.com>
Tue, 7 Jan 2014 21:23:25 +0000 (16:23 -0500)
Verify that affinity scripts work with integration build.

Signed-off-by: Suchi Raman <suchi.raman@plexxi.com>
affinity/api/pom.xml
affinity/api/src/main/java/org/opendaylight/affinity/affinity/AffinityIdentifier.java
affinity/api/src/main/java/org/opendaylight/affinity/affinity/InetAddressMask.java
flatl2/src/main/java/org/opendaylight/affinity/flatl2/FlatL2AffinityImpl.java
pom.xml
scripts/demo.py
scripts/flow-stats.py

index 5fd6005ff4ae0a0cee38d0f700632d74bf085dd6..567f0fb9d47969943c985d866a980de6d95ff411 100644 (file)
       <groupId>org.codehaus.enunciate</groupId>
       <artifactId>enunciate-core-annotations</artifactId>
       <version>${enunciate.version}</version>
-    </dependency>
+    </dependency> 
   </dependencies>
 </project>
index 4388ec3558a55458ae312a7e38d286c3e56656a0..b3ce11162105224b4e02145aa9cd218215c133ff 100644 (file)
@@ -1,10 +1,12 @@
 package org.opendaylight.affinity.affinity;
+import java.io.Serializable;
 
 import java.util.ArrayList;
 import java.util.List;
 
 /* Affinity identifier */
-public class AffinityIdentifier<T> {
+public class AffinityIdentifier<T> implements Serializable, Cloneable {
+    private static final long serialVersionUID = 1L;
     private T value;
     private String name;
 
index de819f1671851d648fe9ff746673a97fac507166..b7a052f36963d5b2972fa5f2ec1c3b3588894b75 100644 (file)
@@ -6,6 +6,7 @@ import java.net.InetAddress;
 import java.nio.ByteBuffer;
 import java.util.Map;
 import java.net.UnknownHostException;
+import java.io.Serializable;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -13,7 +14,7 @@ import org.slf4j.LoggerFactory;
 /**
  * This class defines an Inet address mask object.
  */
-public class InetAddressMask {
+public class InetAddressMask implements Cloneable, Serializable {
     private String name;
     
     InetAddress networkAddress;
index 506434952d38556841341c33bf95c95c00ad6b96..7b9de3bcc960a5a0b8c2d262ace7271906109d9f 100644 (file)
@@ -279,6 +279,7 @@ public class FlatL2AffinityImpl implements IfNewHostNotify {
     // Called via northbound API -- push all affinities. 
     public boolean enableAllAffinityLinks() {
         this.nodelist = switchManager.getNodes();
+        log.info("Enable all affinity links.");
         if (this.nodelist == null) {
             log.debug("No nodes in network.");
             return true;
diff --git a/pom.xml b/pom.xml
index 7c1bdbe992bc475142bee31b415a81cc1d965353..4f1240221e19c4263b3ebe60ba53178010c5051b 100644 (file)
--- a/pom.xml
+++ b/pom.xml
           </dependency>
         </dependencies>
       </plugin>
+<!--      <plugin>
+        <groupId>org.codehaus.enunciate</groupId>
+        <artifactId>maven-enunciate-plugin</artifactId>
+        <version>${enunciate.version}</version>
+        <executions>
+          <execution>
+            <configuration>
+              <configFile>enunciate.xml</configFile>
+            </configuration>
+            <goals>
+              <goal>docs</goal>
+            </goals>
+          </execution>
+        </executions>
+        <dependencies>
+          <dependency>
+            <groupId>org.opendaylight.controller</groupId>
+            <artifactId>commons.logback_settings</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+          </dependency>
+        </dependencies>
+      </plugin> -->
     </plugins>
   </build>
     <reporting>
             </plugin>
         </plugins>
     </reporting>
+
+    <profiles>
+    <profile>
+      <id>docs</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <modules>
+        <module>analytics/northbound</module>
+        <module>affinity/northbound</module>
+        <module>flatl2/northbound</module>
+      </modules>
+    </profile>
+    </profiles>
 </project>
index 74c858d10b1b873b256d31fdba253363d637a475..474568f205453a32be5cfe4a2902c14603706e0c 100644 (file)
@@ -118,7 +118,7 @@ def main():
 
     m = WaypointMonitor(Stats.TYPE_SUBNET, subnet="10.0.0.0/31")
     m.set_waypoint("10.0.0.2")
-    m.set_large_flow_threshold(2000) # 2000 bytes
+    m.set_large_flow_threshold(500) # 2000 bytes
     m.start()
 
     # Register signal-handler to catch SIG_INT
index dba4b3dcef5e4892db16f6b2535fcfdfa0fba970..9a441c1eb42f194b6273d1885188c7a83df56a82 100644 (file)
@@ -40,4 +40,4 @@ def get_all_nodes():
     return nodes
 
 get_flow_stats()
-#get_all_nodes()
+get_all_nodes()