From 6b699b78ee9dcade96adf36555e45798132aaff8 Mon Sep 17 00:00:00 2001 From: Lorand Jakab Date: Wed, 3 Aug 2016 11:59:08 -0500 Subject: [PATCH] Revert "Clustering - adding to LispSouthboundPlugin." This reverts commit c174d5b216d6824714480c8e40a9d1655022c1f7. The reason is to see if it was causing a performance regression (as measured by Jenkins). Change-Id: Ifa8bb37739fc65816f4658178077542800fb80b9 Signed-off-by: Lorand Jakab --- mappingservice/southbound/pom.xml | 4 --- .../southbound/LispSouthboundPlugin.java | 35 ++----------------- .../lisp/LispSouthboundHandler.java | 15 +++----- .../lisp/LispXtrSouthboundHandler.java | 2 +- .../blueprint/mappingservice-southbound.xml | 3 -- .../southbound/LispSouthboundPluginTest.java | 4 +-- 6 files changed, 8 insertions(+), 55 deletions(-) diff --git a/mappingservice/southbound/pom.xml b/mappingservice/southbound/pom.xml index d5f6e8d0d..40368ea51 100644 --- a/mappingservice/southbound/pom.xml +++ b/mappingservice/southbound/pom.xml @@ -17,10 +17,6 @@ ${project.groupId} mappingservice.api - - ${project.groupId} - mappingservice.clustering - ${project.groupId} mappingservice.inmemorydb diff --git a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java index a437edd6f..13e3beef6 100644 --- a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java +++ b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java @@ -31,10 +31,7 @@ import java.util.concurrent.ThreadFactory; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RpcRegistration; -import org.opendaylight.lispflowmapping.clustering.ClusterNodeModulSwitcherImpl; -import org.opendaylight.lispflowmapping.clustering.api.ClusterNodeModuleSwitcher; import org.opendaylight.lispflowmapping.lisp.type.LispMessage; import org.opendaylight.lispflowmapping.southbound.lisp.LispSouthboundHandler; import org.opendaylight.lispflowmapping.southbound.lisp.LispXtrSouthboundHandler; @@ -46,7 +43,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.sb.rev150904.OdlLi import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCloseable, ClusterNodeModuleSwitcher { +public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCloseable { protected static final Logger LOG = LoggerFactory.getLogger(LispSouthboundPlugin.class); private volatile String bindingAddress; @@ -54,7 +51,6 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl private long mapRegisterCacheTimeout; private static Object startLock = new Object(); - private final ClusterNodeModulSwitcherImpl clusterNodeModulSwitcher; private LispSouthboundHandler lispSouthboundHandler; private LispXtrSouthboundHandler lispXtrSouthboundHandler; private NotificationPublishService notificationPublishService; @@ -71,12 +67,9 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl private DataBroker dataBroker; public LispSouthboundPlugin(final DataBroker dataBroker, - final NotificationPublishService notificationPublishService, - final EntityOwnershipService entityOwnershipService) { + final NotificationPublishService notificationPublishService) { this.dataBroker = dataBroker; this.notificationPublishService = notificationPublishService; - clusterNodeModulSwitcher = new ClusterNodeModulSwitcherImpl(entityOwnershipService); - clusterNodeModulSwitcher.setModule(this); } public void init() { @@ -106,7 +99,6 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl LOG.info("LISP (RFC6830) Southbound Plugin is up!"); } - clusterNodeModulSwitcher.switchModuleByEntityOwnership(); } private void start() { @@ -284,27 +276,4 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl lispSouthboundHandler.close(); unloadActions(); } - - @Override - public void stopModule() { - if (lispSouthboundHandler != null) { - lispSouthboundHandler.setNotificationProvider(null); - lispSouthboundHandler.setIsReadFromChannelEnabled(false); - } - if (lispXtrSouthboundHandler != null) { - lispXtrSouthboundHandler.setNotificationProvider(null); - } - } - - @Override - public void startModule() { - if (lispSouthboundHandler != null) { - lispSouthboundHandler.setNotificationProvider(notificationPublishService); - lispSouthboundHandler.restoreDaoFromDatastore(); - lispSouthboundHandler.setIsReadFromChannelEnabled(true); - } - if (lispXtrSouthboundHandler != null) { - lispXtrSouthboundHandler.setNotificationProvider(notificationPublishService); - } - } } diff --git a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java index 1f7347df5..31dfa40cd 100644 --- a/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java +++ b/mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java @@ -94,7 +94,6 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler - @@ -27,7 +25,6 @@ init-method="init" destroy-method="close"> - diff --git a/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java b/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java index c7add0d73..9242172f6 100644 --- a/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java +++ b/mappingservice/southbound/src/test/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPluginTest.java @@ -28,7 +28,6 @@ import org.mockito.ArgumentCaptor; import org.mockito.Mockito; import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService; -import org.opendaylight.controller.md.sal.common.api.clustering.EntityOwnershipService; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; import org.opendaylight.lispflowmapping.lisp.type.LispMessage; import org.opendaylight.lispflowmapping.southbound.lisp.LispSouthboundHandler; @@ -74,8 +73,7 @@ public class LispSouthboundPluginTest { public void init() throws NoSuchFieldException, IllegalAccessException, InterruptedException { lispSouthboundPlugin = new LispSouthboundPlugin( Mockito.mock(DataBroker.class), - Mockito.mock(NotificationPublishService.class), - Mockito.mock(EntityOwnershipService.class)); + Mockito.mock(NotificationPublishService.class)); lispSouthboundPlugin.setBindingAddress(ADDRESS_1); lispSouthboundPlugin.setMapRegisterCacheEnabled(false); channel = PowerMockito.mock(NioDatagramChannel.class); -- 2.36.6