Revert "Added cluster aware mdsal utils class to net-virt."
authorFlavio Fernandes <ffernand@redhat.com>
Wed, 13 Jan 2016 21:34:43 +0000 (21:34 +0000)
committerFlavio Fernandes <ffernand@redhat.com>
Wed, 13 Jan 2016 21:34:43 +0000 (21:34 +0000)
This reverts commit e9ec56b353a2d9098e77d623b7c756069bb58cb9.

This causes a regression in that netvirt:1 is never written to mdsal. to be re-visited.

Change-Id: I683dcac86c23445762d460183fa3e651a600f2c2
Signed-off-by: Flavio Fernandes <ffernand@redhat.com>
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/ClusterAwareMdsalUtils.java [deleted file]
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/OvsdbInventoryServiceImpl.java
openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/impl/SouthboundImpl.java

diff --git a/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/ClusterAwareMdsalUtils.java b/openstack/net-virt/src/main/java/org/opendaylight/ovsdb/openstack/netvirt/ClusterAwareMdsalUtils.java
deleted file mode 100644 (file)
index e892eaa..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 2016 Brocade Communications Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.ovsdb.openstack.netvirt;
-
-import org.opendaylight.controller.md.sal.binding.api.DataBroker;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-/**
- * Class is a wrapper for MdsalUtils.java class. It wrap all the methods
- * from MdsalUtils and call it only when *this* instance is net-virt master
- * instances.
- *
- * Created by vishnoianil on 1/11/16.
- */
-
-public class ClusterAwareMdsalUtils {
-
-    private static final Logger LOG = LoggerFactory.getLogger(ClusterAwareMdsalUtils.class);
-    private final MdsalUtils mdsalUtils;
-
-    /**
-     * Class constructor setting the MdsalUtils instance.
-     *
-     * @param dataBroker the {@link org.opendaylight.controller.md.sal.binding.api.DataBroker}
-     */
-    public ClusterAwareMdsalUtils(DataBroker dataBroker) {
-        mdsalUtils = new MdsalUtils(dataBroker);
-    }
-
-    /**
-     * Wrapper method to executes delete as a blocking transaction.
-     *
-     * @param store {@link LogicalDatastoreType} which should be modified
-     * @param path {@link InstanceIdentifier} to read from
-     * @param <D> the data object type
-     * @return the result of the request
-     */
-    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean delete(
-            final LogicalDatastoreType store, final InstanceIdentifier<D> path)  {
-        if (NetvirtProvider.isMasterProviderInstance()) {
-            return mdsalUtils.delete(store,path);
-        }
-        return true;
-    }
-
-    /**
-     * Wrapper method to executes merge as a blocking transaction.
-     *
-     * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
-     * @param path {@link InstanceIdentifier} for path to read
-     * @param data object of type D
-     * @return the result of the request
-     */
-    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean merge(
-            final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data) {
-        if (NetvirtProvider.isMasterProviderInstance()) {
-            return mdsalUtils.merge(logicalDatastoreType,path, data);
-        }
-        return true;
-    }
-
-    /**
-     * Wrapper method to executes put as a blocking transaction.
-     *
-     * @param logicalDatastoreType {@link LogicalDatastoreType} which should be modified
-     * @param path {@link InstanceIdentifier} for path to read
-     * @param data object of type D
-     * @return the result of the request
-     */
-    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> boolean put(
-            final LogicalDatastoreType logicalDatastoreType, final InstanceIdentifier<D> path, D data) {
-        if (NetvirtProvider.isMasterProviderInstance()) {
-            return mdsalUtils.put(logicalDatastoreType,path, data);
-        }
-        return true;
-    }
-
-    /**
-     * Wrapper method to executes read as a blocking transaction.
-     * Read is open for all instances to execute their normal
-     * control flow. Because with current implementation all the
-     * net-virt instances execute in similar way, because they want
-     * to build their local caches so that all the instances has same
-     * state of internal cache.
-     *
-     * @param store {@link LogicalDatastoreType} to read
-     * @param path {@link InstanceIdentifier} for path to read
-     * @param <D> the data object type
-     * @return the result as the data object requested
-     */
-    public <D extends org.opendaylight.yangtools.yang.binding.DataObject> D read(
-            final LogicalDatastoreType store, final InstanceIdentifier<D> path)  {
-        return mdsalUtils.read(store,path);
-    }
-}
index 120e3ce938ddd46ada19f0c78e944fb6d2f15f93..481da49b4fa2f78a30b24265b81c85b9e12e077f 100644 (file)
@@ -14,7 +14,6 @@ import java.util.Set;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
-import org.opendaylight.ovsdb.openstack.netvirt.ClusterAwareMdsalUtils;
 import org.opendaylight.ovsdb.openstack.netvirt.ConfigInterface;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Constants;
 import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbInventoryService;
@@ -27,6 +26,7 @@ import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronSe
 import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronSubnetChangeListener;
 import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronLoadBalancerPoolChangeListener;
 import org.opendaylight.ovsdb.openstack.netvirt.translator.iaware.impl.NeutronLoadBalancerPoolMemberChangeListener;
+import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
@@ -48,13 +48,13 @@ public class OvsdbInventoryServiceImpl implements ConfigInterface, OvsdbInventor
     private static DataBroker dataBroker = null;
     private static Set<OvsdbInventoryListener> ovsdbInventoryListeners = Sets.newCopyOnWriteArraySet();
     private OvsdbDataChangeListener ovsdbDataChangeListener = null;
-    private static ClusterAwareMdsalUtils mdsalUtils = null;
+    private static MdsalUtils mdsalUtils = null;
 
     public OvsdbInventoryServiceImpl(ProviderContext providerContext) {
         dataBroker = providerContext.getSALService(DataBroker.class);
         LOG.info("OvsdbInventoryServiceImpl initialized");
         ovsdbDataChangeListener = new OvsdbDataChangeListener(dataBroker);
-        mdsalUtils = new ClusterAwareMdsalUtils(dataBroker);
+        mdsalUtils = new MdsalUtils(dataBroker);
     }
 
     @Override
index a926b93316430b9dd8c0fcfca6d9e1e8d1fe8453..e280edeb77dd45cf2f7e443cd62247e71df0b64c 100644 (file)
@@ -16,11 +16,11 @@ import java.util.Map;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.ovsdb.openstack.netvirt.ClusterAwareMdsalUtils;
 import org.opendaylight.ovsdb.openstack.netvirt.MdsalHelper;
 import org.opendaylight.ovsdb.openstack.netvirt.NetworkHandler;
 import org.opendaylight.ovsdb.openstack.netvirt.api.OvsdbTables;
 import org.opendaylight.ovsdb.openstack.netvirt.api.Southbound;
+import org.opendaylight.ovsdb.utils.mdsal.utils.MdsalUtils;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Uri;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.*;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeExternalIds;
@@ -65,7 +65,7 @@ public class SouthboundImpl implements Southbound {
     private static final Logger LOG = LoggerFactory.getLogger(SouthboundImpl.class);
     private final DataBroker databroker;
     private static final String PATCH_PORT_TYPE = "patch";
-    private final ClusterAwareMdsalUtils mdsalUtils;
+    private final MdsalUtils mdsalUtils;
 
     /**
      * Class constructor setting the data broker.
@@ -74,7 +74,7 @@ public class SouthboundImpl implements Southbound {
      */
     public SouthboundImpl(DataBroker dataBroker) {
         this.databroker = dataBroker;
-        mdsalUtils = new ClusterAwareMdsalUtils(dataBroker);
+        mdsalUtils = new MdsalUtils(dataBroker);
     }
 
     public DataBroker getDatabroker() {