Decouple IContainerListener to avoid parallel computation in cluster 68/1468/1
authorAlessandro Boch <aboch@cisco.com>
Fri, 27 Sep 2013 15:39:49 +0000 (08:39 -0700)
committerAlessandro Boch <aboch@cisco.com>
Fri, 27 Sep 2013 15:53:56 +0000 (08:53 -0700)
commit9aa1a4e8c24292301eac8a9fa71f39744c37eda4
tree068ba5755b6f51622632d8674e50382934079634
parentdfec2688d4213adc433187295d6667cea746d68c
Decouple IContainerListener to avoid parallel computation in cluster

ISSUE: On Container configuration change, or when they register with ContainerManager,
IContainerListener classes are notified locally and on all cluster nodes.
While cluster unaware classes like the Shim classes in the protocol plugin need this
notification on all the nodes to keep their local container related info up to date,
Functional Modules like FRM which are cluster aware do not need to be notified as they
react on these notifications performing flow operations. Currently all the FRMs in the
cluster reacts in parallel on Container Flow changes...

CHANGE: From Container config notification prespective, decouple the cluster aware classes
from the cluster unaware ones having the former register to a new IContainerLocal interface
instead of IContainerListener. On Container config changes, IContainerLocalListener will be
notified only on the controller node on which the configuration was applied (from GUI or NB).
On the remote controllers, where ContainerManager replays the configuration events, only
cluster unaware listeners will be notified.
Also, on IContainerLocalListener registration callback, in contrast with IContainerListener
registration callback, no container configurations bulk update will be pushed.
Simply because the FMs do not need to keep a local container information copy, they do not
care about the past events, they only need to be notified about a live config change event
which they use as a trigger to perform whatever task on their DB. If the task requires the
knowledge of the container config, they directly request it to Container Manager on the fly.

Change-Id: Icbaca58e04d60463b3aa54a61a4a1a467222d18e
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/Activator.java
opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/Activator.java
opendaylight/forwardingrulesmanager/implementation/src/main/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManager.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/IContainerLocalListener.java [new file with mode: 0644]