Fixes for MD-FRM 16/3116/12
authorEd Warnicke <eaw@cisco.com>
Wed, 27 Nov 2013 02:30:52 +0000 (18:30 -0800)
committerEd Warnicke <eaw@cisco.com>
Wed, 27 Nov 2013 12:07:25 +0000 (04:07 -0800)
commit330e442610ae7a8b43a8ea5dc77c273f906b9dc9
treeaa2e2ab6bcda84aaceb941cf9c98d8f831b1a428
parent83ce8d8b0b6ea253a261a0894a07158dfb852787
Fixes for MD-FRM

Patch 1:  Fix MD-FRM to listen to the correct portion of the data tree.
Currently we listen to /flows/flow/ for which we would need to specify a
key to indicate which flow in the tree we wanted to listen to.  Changing to
listen to /flows/ and thus hear commits involving all flows.

Patch 2:  Unpack Entry... we need the value of the entry which is a DataObject.
Otherwise, the cast fails.

Patch 3: NodeFlow is only used as an input to rpcs towards the
openflowplugin, it does not get filed in the data tree.  Flow gets
filed in the data tree.  Addtionally, commits can come in with multiple
objects, so if we get a commit with other things, we either need to ignore
them or handle them... but blindly casting them will not work.

Patch 4: Change to cope with moving from NodeFlow to Flow.  Fortunately,
NodeFlow is just Flow plus a NodeRef plus a TableRef, so it pretty much just
worked (at least at the typing level... not to running yet).

Patch 5: Fixed an NPE by providing a Collections.<RpcError>emptySet() for
RpcErrors instead of null.

Patch 6: Fixed a failure due to attempt to check with the old AD-SAL
infra for the Node.  This will not work correctly.  Added TODO for
validation of the node.  Also cleaned up substantially handling of
error conditions while I was in the neighborhood.

Patch 7: Something in the current use of ClusteringServices for
validation is breaking things.  At first it looked like
we were just trying to allocate caches before we initialized
out clustering services variable, and thus failing... but at
the end of the day there is more wrong here than make sense
to debug at this time... so commented out.

Patch 8: Get the modifications from the transaction and
deal with the create, updated, removed.  Also handled the
cast to Flow.  Put a small null check around handling of
instructions in FRMUtil.

Patch 9: Something in the current use of ClusteringServices
is breaking things. Commenting out in order to get things working.

Patch 10: Correctly sorted out the creates from the removes
from the *true* updates.  Note, both creates and updates appear
as updates... so you have to do a little setwise subtraction.
Also note, the Collections you get back are immutable, so
you have to do that subtraction with care.

Victory!  As of Patch 10 I can confirm using
https://git.opendaylight.org/gerrit/#/c/3118/

That flows being added, removed, or updated are being
correctly wired to an RPC that is registered for them.

Change-Id: Iee020938d201f3df0629b2df13a85ad023c808ac
Signed-off-by: Ed Warnicke <eaw@cisco.com>
opendaylight/md-sal/forwardingrules-manager/pom.xml
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/consumer/impl/FRMUtil.java
opendaylight/md-sal/forwardingrules-manager/src/main/java/org/opendaylight/controller/forwardingrulesmanager/consumer/impl/FlowConsumerImpl.java