Hey Sela,

So I started going through the code for DataTreeChangeListener registration
which led me to the following code:

https://github.com/opendaylight/controller/blob/master/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/AbstractDOMStoreTreeChangePublisher.java#L58

and

https://github.com/opendaylight/controller/blob/master/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/AbstractDOMStoreTreeChangePublisher.java#L93

and

https://github.com/opendaylight/controller/blob/master/opendaylight/md-sal/sal-dom-spi/src/main/java/org/opendaylight/controller/sal/core/spi/data/AbstractDOMStoreTreeChangePublisher.java#L110

Just go through these, it seems listeners are getting notified as the tree
is traversed. Hence you are not getting the snapshot as one whole snapshot.

Tom, please correct me if I am wrong.

On Tue, Nov 29, 2016 at 5:55 PM, Sela, Guy <[email protected]> wrote:

> I’m pretty sure there is a bug there.
>
> I’m working on Boron-SR1.
>
> I am doing a read on ElanInterfaces with InstanceIdentifier:
> InstanceIdentifier.create(ElanInterfaces.class)
>
> On the result I’m invoking:
>
> ElanInterfaces.getElanInteface().size().
>
> Result is 6.
>
> Next line of code I’m registering a ClusteredDataTreeChangeListener on
> ElanInterface:
>
> InstanceIdentifier.create(ElanInterfaces.class).child(
> ElanInterface.class)).
>
> The first onDataTreeChanged I’m getting contains only *one *
> DataTreeModification.
>
> In subsequent notifications I’m getting the rest of the pre-existing data.
>
> This same behavior repeats itself in other entities too, and in different
> setups.
>
>
>
> *From:* Tom Pantelis [mailto:[email protected]]
> *Sent:* Tuesday, November 29, 2016 1:59 PM
> *To:* Sela, Guy <[email protected]>
> *Cc:* [email protected]; controller-dev@lists.
> opendaylight.org
> *Subject:* Re: [controller-dev] DataTreeChangeService - pre-existing data
>
>
>
> yes - on registration it grabs the current data tree and sends it. If
> you're getting subsequent data then that must have occurred after your
> registration.
>
>
>
> On Tue, Nov 29, 2016 at 6:53 AM, Sela, Guy <[email protected]> wrote:
>
> Hi,
>
>
>
> In the Javadoc of DataTreeChangeService it says:
>
> “
>
> If there is any pre-existing data in the data tree for the path for which
> you are
>
> registering, you will receive *an initial data change event*, which will
>
> contain all pre-existing data, marked as created.
>
> “
>
>
>
> Is this behavior guaranteed? Will all the existing data be received in a
> single “onDataTreeChanged” invocation?
>
> I’m registering a ClusteredDataTreeChangeListener in my usecase, and I
> see that I don’t receive all the data in the first call.
>
>
>
>
>
> Thanks,
>
> Guy Sela
>
>
>
>
> _______________________________________________
> controller-dev mailing list
> [email protected]
> https://lists.opendaylight.org/mailman/listinfo/controller-dev
>
>
>
> _______________________________________________
> controller-dev mailing list
> [email protected]
> https://lists.opendaylight.org/mailman/listinfo/controller-dev
>
>
-Faiz
_______________________________________________
controller-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/controller-dev

Reply via email to