BUG-4034: Missing barrier after flow remove 79/24379/1
authorMichal Rehak <mirehak@cisco.com>
Wed, 22 Jul 2015 08:28:29 +0000 (10:28 +0200)
committerMichal Rehak <mirehak@cisco.com>
Wed, 22 Jul 2015 08:28:29 +0000 (10:28 +0200)
 - fixed barrier support for:
    - flow: remove
    - meter: remove, update
    - group: remove, update

Change-Id: I5934923614e7572343ce5bef068f74c0c7a5fb69
Signed-off-by: Michal Rehak <mirehak@cisco.com>
openflowplugin/src/main/java/org/opendaylight/openflowplugin/openflow/md/core/sal/OFRpcTaskFactory.java

index 1ef7abe356bf0a27e49de9aff850f2b0b46d6451..bf69c4f7165be29824ecef9dcc601d0c03cf1a23 100644 (file)
@@ -7,24 +7,21 @@
  */
 package org.opendaylight.openflowplugin.openflow.md.core.sal;
 
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef;
-
-import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import com.google.common.base.Optional;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
-import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import com.google.common.util.concurrent.AsyncFunction;
 import com.google.common.util.concurrent.CheckedFuture;
-import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowHashIdMapping;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMapKey;
+import com.google.common.util.concurrent.FutureCallback;
+import com.google.common.util.concurrent.Futures;
+import com.google.common.util.concurrent.JdkFutureAdapters;
+import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.SettableFuture;
 import java.math.BigInteger;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.Future;
+import org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction;
+import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
+import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
 import org.opendaylight.openflowjava.protocol.api.util.BinContent;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.md.core.SwitchConnectionDistinguisher;
@@ -38,6 +35,11 @@ import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.TableFeatu
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.match.MatchReactor;
 import org.opendaylight.openflowplugin.openflow.md.util.FlowCreatorUtil;
 import org.opendaylight.openflowplugin.openflow.md.util.InventoryDataServiceUtil;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowHashIdMapping;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMap;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.nodes.node.table.FlowHashIdMapKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.Table;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.tables.table.FlowKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.FlowAdded;
@@ -73,6 +75,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.table.statistics.rev13
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.transaction.rev150304.TransactionId;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.Port;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.Flow;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.FlowRef;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAdded;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.GroupAddedBuilder;
@@ -176,17 +179,13 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.queue.statistics.rev131216.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutputBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcError.ErrorType;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import com.google.common.util.concurrent.AsyncFunction;
-import com.google.common.util.concurrent.FutureCallback;
-import com.google.common.util.concurrent.Futures;
-import com.google.common.util.concurrent.JdkFutureAdapters;
-import com.google.common.util.concurrent.ListenableFuture;
-import com.google.common.util.concurrent.SettableFuture;
 
 /**
  *
@@ -599,6 +598,11 @@ public abstract class OFRpcTaskFactory {
 
                 return result;
             }
+
+            @Override
+            public Boolean isBarrier() {
+                return getInput().getUpdatedGroup().isBarrier();
+            }
         }
 
         return new OFRpcTaskImpl(taskContext, cookie, input);
@@ -656,6 +660,11 @@ public abstract class OFRpcTaskFactory {
                         getRpcNotificationProviderService(), createMeterUpdatedNotification(getInput()));
                 return result;
             }
+
+            @Override
+            public Boolean isBarrier() {
+                return getInput().getUpdatedMeter().isBarrier();
+            }
         }
 
         return new OFRpcTaskImpl(taskContext, cookie, input);
@@ -711,6 +720,11 @@ public abstract class OFRpcTaskFactory {
                         createFlowRemovedNotification(getInput()));
                 return result;
             }
+
+            @Override
+            public Boolean isBarrier() {
+                return getInput().isBarrier();
+            }
         }
 
         return new OFRpcTaskImpl(taskContext, cookie, input);
@@ -770,6 +784,11 @@ public abstract class OFRpcTaskFactory {
 
                 return result;
             }
+
+            @Override
+            public Boolean isBarrier() {
+                return getInput().isBarrier();
+            }
         }
 
         return new OFRpcTaskImpl(taskContext, cookie, input);
@@ -828,6 +847,11 @@ public abstract class OFRpcTaskFactory {
 
                 return result;
             }
+
+            @Override
+            public Boolean isBarrier() {
+                return getInput().isBarrier();
+            }
         }
 
         return new OFRpcTaskImpl(taskContext, cookie, input);