13:33:51 <devinavery> #startmeeting jquery_xpath_for_md_sal_intern
13:33:51 <odl_meetbot> Meeting started Tue Aug 19 13:33:51 2014 UTC.  The chair is devinavery. Information about MeetBot at http://ci.openstack.org/meetbot.html.
13:33:51 <odl_meetbot> Useful Commands: #action #agreed #help #info #idea #link #topic #startvote.
13:33:51 <odl_meetbot> The meeting name has been set to 'jquery_xpath_for_md_sal_intern'
13:33:54 * regXboi a little distracted this morning - trying to review code without a patchset is a PiA
13:33:59 <devinavery> #chair regXboi
13:33:59 <odl_meetbot> Current chairs: devinavery regXboi
13:34:06 <regXboi> not related to this however!
13:36:57 <Neel_B> github code updated
13:38:03 <Neel_B> tests not working with lists
13:38:19 <Neel_B> check the resources folder for the new yang file
13:38:32 <devinavery> Neel_B do you have a copy of the XML for lists available?
13:38:35 <regXboi> is there a pastebin with the error?
13:38:36 <Neel_B> and check nodebuilderelement.java
13:39:02 <Neel_B> No
13:39:04 <devinavery> #info Neel_B has modified the toaster.yang to include list elements. Updated test code and presently that test code is failing
13:39:08 <Neel_B> Lists are bit conusing
13:39:25 <devinavery> Ok.
13:39:30 <regXboi> so two questions
13:39:44 <regXboi> (1) does the XML output test fail?
13:39:50 <Neel_B> check out the yang and opendaylighttoaster.java and tell me if i did the things right
13:40:16 <regXboi> the second question depends on the answer to the first ;)
13:40:18 <Neel_B> check out the mail for opendaylighttoaster.java
13:41:38 <Neel_B> https://gist.github.com/neel1438/fd92e4c5d673f29d01ca
13:41:44 <Neel_B> failtrace
13:42:58 <devinavery> OpendayLight java code looks right
13:43:07 <devinavery> at least at first glance. :)
13:45:41 <Neel_B> so change to be made in nodebuilderelement.java i have tried some thing
13:46:22 <Neel_B> correct me review the code , add some thing
13:47:20 <Neel_B> regXboi: there is error in implementation so no xml output
13:47:49 <Neel_B> But all the tests are passing in the nested case
13:48:07 <devinavery> Output XML with lists as returned from netconf available here: http://pastebin.com/fkivuMTb
13:48:55 <Neel_B> that should be the output or
13:49:03 <Neel_B> you got that out put
13:49:04 <Neel_B> ?
13:49:16 <Neel_B> okay got through netconf
13:49:22 <devinavery> I got that XML via restconf.
13:49:34 <devinavery> I want to compare it to what we get in your test
13:49:44 <devinavery> Speaking of which, I am not seeing the tests which specifically deal with the lists
13:50:13 <devinavery> Did you add tests to validate the lists?
13:50:56 <Neel_B> i just run it
13:51:07 <devinavery> ??
13:51:10 <Neel_B> have you seen the error trace
13:51:21 <Neel_B> even if i add these lists
13:51:28 <Neel_B> the above tests should pass
13:51:36 <Neel_B> so i directly run the test
13:51:45 <devinavery> This is the XML I see printed when I just run the test:
13:51:47 <devinavery> <?xml version="1.0" encoding="UTF-8"?><toaster>
13:51:47 <devinavery> <toasterManufacturer>Opendaylight</toasterManufacturer>
13:51:47 <devinavery> <toasterModelNumber>Model 1 - Binding Aware</toasterModelNumber>
13:51:47 <devinavery> <childtoasterlist/>
13:51:47 <devinavery> <toasterStatus>up</toasterStatus>
13:51:48 <devinavery> <childtoaster>
13:51:50 <devinavery> <toasterMaker>ChildOpendaylight</toasterMaker>
13:51:54 <devinavery> <toasterModel>ChildModel 1 - Binding Aware</toasterModel>
13:51:56 <devinavery> </childtoaster>
13:51:58 <devinavery> </toaster>
13:52:19 <Neel_B> that is because i did not handle the list case
13:52:27 <Neel_B> look at nodebuildeelement
13:52:45 <Neel_B> you will get why the output
13:52:52 <devinavery> Ok. Understood.
13:53:11 <devinavery> So I am seeing a failure now on the "toasterStatus" test. Is that where you are?
13:54:29 <Neel_B> i have not run the tests after i semi-modified the nodebuilderelement.java
13:54:32 <Neel_B> running now
13:55:06 <devinavery> Ok, so I guess I should ask this question then: Are you blocked by anything? Or do you have a clear idea of what the next steps are? :)
13:55:31 <Neel_B> i need some help
13:55:39 <Neel_B> i can finish it
13:56:40 <devinavery> Ok. What questions do you have / help do you need?
13:56:50 <Neel_B> if the node is instance of org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode
13:57:30 <Neel_B> how to get the individual element from it i.e individual normalized node
13:58:13 <devinavery> According to the java docs: rdering of the elements is user-defined during construction of instance of this
13:58:13 <devinavery> * interface. Ordered view of elements (iteration)
13:58:13 <devinavery> * is provided by {@link #getValue()} call.
13:58:33 <devinavery> Sorry - first word there dis "Ordering of the elements..."
13:58:55 <devinavery> #info Neel_B has a question about how to access the nodes in a list. <Neel_B> if the node is instance of org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode
13:58:55 <devinavery> [09:57]  <Neel_B> how to get the individual element from it i.e individual normalized node
13:59:10 <devinavery> #info part 2 of question: <Neel_B> how to get the individual element from it i.e individual normalized node
14:00:21 <Neel_B> can you send me the link of javadocs
14:00:47 <devinavery> #info: Answer from devinavery: according to javadocs it should just be a call to the getValue() method on the interface.
14:01:00 <devinavery> Do you have the controller code importeD?
14:01:21 <Neel_B> yeah
14:01:32 <Neel_B> but not latest thoufh
14:01:35 <devinavery> Ok. Then just look for the UnkeyedListNode class in eclipse
14:01:40 <Neel_B> haven't updated lately
14:01:40 <devinavery> I don't think code has changed recently
14:01:56 <Neel_B> okay not into eclipse
14:01:58 <Neel_B> sorry
14:02:21 <regXboi> devinavery - you are thinking of getValue on the unkeyedlistnode and then just iterating through the return?
14:02:43 <devinavery> regXboi: yes - that is what I am guessing based on the comments
14:03:27 <regXboi> devinavery: thanks that means I'm up to date
14:03:33 <Neel_B> i have implemented that  port
14:03:37 <Neel_B> part*
14:03:42 <Neel_B> running tests
14:03:44 <devinavery> ok.
14:04:00 <devinavery> Can you paste code snippet either here or paste bin so we can copy locally? :)
14:04:36 <Neel_B> node.getvalue() is a normalized node
14:04:52 <Neel_B> so we can directly handle it
14:05:09 <devinavery> Ok. Sounds good.
14:05:11 <Neel_B> even if it had children or lists or anything
14:05:37 <devinavery> Ultimately you want to have your code end up producing XML that looks like what I sent in the paste bin above
14:05:59 <Neel_B> yeah
14:06:09 <Neel_B> but some new error has come up
14:06:32 <devinavery> Ok. Do you think you can work through it?
14:06:41 <Neel_B> https://gist.github.com/neel1438/fd92e4c5d673f29d01ca
14:07:32 <devinavery> Ok So it looks like you are getting back a list but are trying to cast it to a DataCOntainerNode which will not work
14:08:13 <Neel_B> okay so same question
14:08:34 <Neel_B> any docs so that we can get children of the list
14:08:44 <Neel_B> i will just add one more if
14:09:04 <devinavery> That list most likely contains the children.
14:09:39 <devinavery> I would cast it to an iterable (all lists should be iterable) and then pop each node off and see what type they are. Most likely they are one of our special types.
14:11:47 <regXboi> agreed
14:15:48 <Neel_B> its getting messier but i am trying
14:21:14 <regXboi> I'm confused...
14:21:18 <regXboi> why do i need to cast?
14:21:56 <regXboi> regulareimmutablelist has an iterator method that returns a UnmodifiableIterator<E>
14:22:08 <regXboi> we can iterator through that and check the types
14:22:29 <regXboi> or did I miss an orbit?
14:22:36 <Neel_B> actaully node.getValue
14:22:43 <Neel_B> gives out an object
14:22:54 <Neel_B> which happens to be immutable list
14:23:05 <regXboi> right... that has an iterator
14:23:11 <Neel_B> object has no iterator
14:23:19 <regXboi> no... but immutable list does
14:23:34 <Neel_B> returned is object not immutable list
14:23:54 <regXboi> ok, so that's why the cast
14:24:11 <Neel_B> even if i cast i am getting error
14:24:38 <regXboi> what error are you getting?
14:24:52 <Neel_B> okay
14:24:57 <Neel_B> i did that wrong
14:25:03 <Neel_B> now i got the list
14:25:28 <regXboi> good - with the list, you should be able to iterate through and see what the object types are
14:26:34 <Neel_B> yeah
14:29:21 <regXboi> #info when dealing with lists, the getValue returns an object which has to be cast to RegularImmutableList which then can be iterated through
14:30:23 <devinavery> One comment - I would cast to "Iterable" or List instead of RegularImmutableList - Leaves the door open for the implementation to change in the future.
14:31:54 <Neel_B> ImmutableList<NormalizedNode<?,?>> list=((ImmutableList<NormalizedNode<?, ?>>) node.getValue())
14:32:07 <Neel_B> presnetly i did this
14:32:20 <Neel_B> running tests
14:33:56 <devinavery> Neel_B: thats fine for now. I would change to Iterable<NormalizedNode<?,?>> later on.
14:35:03 <Neel_B> oh my god
14:35:35 <Neel_B> the children element are ImmutableLeafSetNode
14:37:40 <regXboi> that's got to be a special class
14:37:41 <devinavery> I that is because you made the inner type of the element LeafList
14:37:42 <devinavery> :)
14:37:58 <devinavery> So you have a list of lists in your yang
14:38:22 <devinavery> So the LeafSetNode = LeafList which is just another type of iterable child that we need to handle. :)
14:38:49 <devinavery> Guys. I need to jump on my VPN.
14:38:51 <devinavery> Back in just a minute
14:39:51 <devinavery> Back
14:44:07 <Neel_B> so its a good thing i did add leaflist as child of containerlist
14:44:22 <Neel_B> we actually covered many cases through one example
14:46:30 <devinavery> Yup. :) There are more scenarios that we need to add, but you have covered the majority of them so far
14:48:14 <Neel_B> children of  leaflist is leafsetentrynode
14:48:25 <Neel_B> another type checking
14:48:36 <Neel_B> i will figure out all this
14:48:49 <Neel_B> can you briefly discuss next steps
14:49:03 <regXboi> yes, I have a call at the top of the hour, so I have to run
14:49:05 <Neel_B> regXboi devinavery
14:49:41 <devinavery> Ok. So I think the next steps are the following: 1) Finish up the tests and get the lists passing (use the XML I provided in the paste bin to validate output etc).
14:50:07 <Neel_B> okay then >
14:50:09 <Neel_B> ?
14:50:12 <devinavery> 2) We need to get this code checked into ODL so it can be incorporated eventually into the project
14:50:25 <Neel_B> i didn't get you
14:50:37 <Neel_B> code checked into odl ?
14:50:40 <regXboi> yes
14:50:47 <devinavery> Ok. So we need to check all of your code into the actual Opendaylight git source control
14:51:01 <regXboi> which means we should do some friendly things there
14:51:12 <Neel_B> okay ... i have to change things i guess
14:51:14 <regXboi> like javadoc comments
14:51:25 <regXboi> and a little restructuring
14:52:00 <Neel_B> then my main question is how do we automate it ?
14:52:12 <devinavery> right now I would suggest a new bundle under controller/opendaylight/md-sal/ perhaps called "query"
14:52:13 <Neel_B> like put it as a layer
14:52:39 <Neel_B> okay
14:52:45 <devinavery> I think the first thing we need to do is get the functionality checked in, then we can look at how we wire it all in.
14:52:57 <regXboi> devinavery: +1
14:52:58 <devinavery> We also need to think about what the API for the query language will be etc. We have skipped a lot of that right now.
14:53:12 <devinavery> But lets start with getting your code checked into the controller and then we can go from there.
14:53:27 <regXboi> I think we can just say for the moment - this turns MD-SAL back into XML
14:53:38 <regXboi> and you can use your favorite XML tools to query it
14:53:43 <devinavery> I would suggest the following bundles (at least 2).  1)  controller/opendaylight/md-sal/query/xpath  and  controller/opendaylight/md-sal/query/xpath-it
14:54:00 <devinavery> The xpath bundle should contain the logic such as the node wrappers etc, and the xpath-it should contain all of the testing.
14:54:47 <devinavery> We might even be able to look at how we could integrate this with restconf as well ( I can give that some thought). In the mean time we do need first get the source checked in.
14:54:53 <devinavery> So let me #info the next steps.
14:54:59 <regXboi> info or action?
14:55:02 <devinavery> #topic next steps
14:55:11 <devinavery> good point - action
14:55:26 <devinavery> #action Neel_B will get the list xpath code working and tests passing.
14:55:57 <devinavery> #action Neel_B will clean up the code by removing trailing whitespace, replacing tabs with spaces, etc
14:56:19 <Neel_B> that thing has been done
14:56:21 <Neel_B> perfectly
14:56:24 <devinavery> #action Neel_B will add java doc comments to code that exists so far to explain what classes are doing and to explain any complex methods etc
14:56:51 <Neel_B> i don't know how to write the javdoc comments
14:56:57 <Neel_B> i never wrote for any
14:56:59 <devinavery> #action Neel_B will then check code into ODL gerrit (be sure to put [DO NOT MERGE] in the commit message so it is not merged)
14:57:27 <devinavery> #action devinavery to send some info to Neel_B with some simple examples of javadoc comments
14:58:25 <devinavery> #info When checking code in devinavery suggest two bundles - a source bundle and a test bundle under the following paths: controller/opendaylight/md-sal/query/xpath and  controller/opendaylight-md-sal/query/xpath-it
14:59:04 <devinavery> Neel_B I will send some java doc examples via e-mail. It is pretty easy though. Just put comments /**   .... comments go here */ over a class or method name. All text becomes java doc comments
14:59:52 <regXboi> works for me
14:59:58 <devinavery> #link http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html Oracle java doc introduction
15:00:31 <regXboi> and once we have a patchset to base off of, we can add things to it
15:00:35 <Neel_B> i guess i restructured some
15:00:44 <devinavery> #info Neel_B can check out the above link which is oracles site on java doc. Lots of info there, but if you focus on the "Format of a Doc Comment" that should be enough to get you started
15:00:55 <Neel_B> and running tests
15:01:10 <devinavery> Neel_B regXboi - How do these action items sound?
15:01:54 <Neel_B> good enough
15:01:57 <regXboi> yes, they work for me
15:01:58 <Neel_B> i guess
15:02:11 <Neel_B> will have test result in a minute
15:02:39 <devinavery> Ok. Neel_B - feel free to reach out if you have any questions on the specifics. We can sync up again tomorrow to see where you stand. If you get your code checked into to a gerrit send me the number and we can start more detail code reviews that way
15:02:55 <devinavery> #info Next meeting at the same time tomorrow (already scheduled)
15:02:58 <devinavery> #endmeeting