13:33:51 #startmeeting jquery_xpath_for_md_sal_intern 13:33:51 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 Useful Commands: #action #agreed #help #info #idea #link #topic #startvote. 13:33:51 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 #chair regXboi 13:33:59 Current chairs: devinavery regXboi 13:34:06 not related to this however! 13:36:57 github code updated 13:38:03 tests not working with lists 13:38:19 check the resources folder for the new yang file 13:38:32 Neel_B do you have a copy of the XML for lists available? 13:38:35 is there a pastebin with the error? 13:38:36 and check nodebuilderelement.java 13:39:02 No 13:39:04 #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 Lists are bit conusing 13:39:25 Ok. 13:39:30 so two questions 13:39:44 (1) does the XML output test fail? 13:39:50 check out the yang and opendaylighttoaster.java and tell me if i did the things right 13:40:16 the second question depends on the answer to the first ;) 13:40:18 check out the mail for opendaylighttoaster.java 13:41:38 https://gist.github.com/neel1438/fd92e4c5d673f29d01ca 13:41:44 failtrace 13:42:58 OpendayLight java code looks right 13:43:07 at least at first glance. :) 13:45:41 so change to be made in nodebuilderelement.java i have tried some thing 13:46:22 correct me review the code , add some thing 13:47:20 regXboi: there is error in implementation so no xml output 13:47:49 But all the tests are passing in the nested case 13:48:07 Output XML with lists as returned from netconf available here: http://pastebin.com/fkivuMTb 13:48:55 that should be the output or 13:49:03 you got that out put 13:49:04 ? 13:49:16 okay got through netconf 13:49:22 I got that XML via restconf. 13:49:34 I want to compare it to what we get in your test 13:49:44 Speaking of which, I am not seeing the tests which specifically deal with the lists 13:50:13 Did you add tests to validate the lists? 13:50:56 i just run it 13:51:07 ?? 13:51:10 have you seen the error trace 13:51:21 even if i add these lists 13:51:28 the above tests should pass 13:51:36 so i directly run the test 13:51:45 This is the XML I see printed when I just run the test: 13:51:47 13:51:47 Opendaylight 13:51:47 Model 1 - Binding Aware 13:51:47 13:51:47 up 13:51:48 13:51:50 ChildOpendaylight 13:51:54 ChildModel 1 - Binding Aware 13:51:56 13:51:58 13:52:19 that is because i did not handle the list case 13:52:27 look at nodebuildeelement 13:52:45 you will get why the output 13:52:52 Ok. Understood. 13:53:11 So I am seeing a failure now on the "toasterStatus" test. Is that where you are? 13:54:29 i have not run the tests after i semi-modified the nodebuilderelement.java 13:54:32 running now 13:55:06 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 i need some help 13:55:39 i can finish it 13:56:40 Ok. What questions do you have / help do you need? 13:56:50 if the node is instance of org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode 13:57:30 how to get the individual element from it i.e individual normalized node 13:58:13 According to the java docs: rdering of the elements is user-defined during construction of instance of this 13:58:13 * interface. Ordered view of elements (iteration) 13:58:13 * is provided by {@link #getValue()} call. 13:58:33 Sorry - first word there dis "Ordering of the elements..." 13:58:55 #info Neel_B has a question about how to access the nodes in a list. if the node is instance of org.opendaylight.yangtools.yang.data.api.schema.UnkeyedListNode 13:58:55 [09:57] how to get the individual element from it i.e individual normalized node 13:59:10 #info part 2 of question: how to get the individual element from it i.e individual normalized node 14:00:21 can you send me the link of javadocs 14:00:47 #info: Answer from devinavery: according to javadocs it should just be a call to the getValue() method on the interface. 14:01:00 Do you have the controller code importeD? 14:01:21 yeah 14:01:32 but not latest thoufh 14:01:35 Ok. Then just look for the UnkeyedListNode class in eclipse 14:01:40 haven't updated lately 14:01:40 I don't think code has changed recently 14:01:56 okay not into eclipse 14:01:58 sorry 14:02:21 devinavery - you are thinking of getValue on the unkeyedlistnode and then just iterating through the return? 14:02:43 regXboi: yes - that is what I am guessing based on the comments 14:03:27 devinavery: thanks that means I'm up to date 14:03:33 i have implemented that port 14:03:37 part* 14:03:42 running tests 14:03:44 ok. 14:04:00 Can you paste code snippet either here or paste bin so we can copy locally? :) 14:04:36 node.getvalue() is a normalized node 14:04:52 so we can directly handle it 14:05:09 Ok. Sounds good. 14:05:11 even if it had children or lists or anything 14:05:37 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 yeah 14:06:09 but some new error has come up 14:06:32 Ok. Do you think you can work through it? 14:06:41 https://gist.github.com/neel1438/fd92e4c5d673f29d01ca 14:07:32 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 okay so same question 14:08:34 any docs so that we can get children of the list 14:08:44 i will just add one more if 14:09:04 That list most likely contains the children. 14:09:39 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 agreed 14:15:48 its getting messier but i am trying 14:21:14 I'm confused... 14:21:18 why do i need to cast? 14:21:56 regulareimmutablelist has an iterator method that returns a UnmodifiableIterator 14:22:08 we can iterator through that and check the types 14:22:29 or did I miss an orbit? 14:22:36 actaully node.getValue 14:22:43 gives out an object 14:22:54 which happens to be immutable list 14:23:05 right... that has an iterator 14:23:11 object has no iterator 14:23:19 no... but immutable list does 14:23:34 returned is object not immutable list 14:23:54 ok, so that's why the cast 14:24:11 even if i cast i am getting error 14:24:38 what error are you getting? 14:24:52 okay 14:24:57 i did that wrong 14:25:03 now i got the list 14:25:28 good - with the list, you should be able to iterate through and see what the object types are 14:26:34 yeah 14:29:21 #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 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 ImmutableList> list=((ImmutableList>) node.getValue()) 14:32:07 presnetly i did this 14:32:20 running tests 14:33:56 Neel_B: thats fine for now. I would change to Iterable> later on. 14:35:03 oh my god 14:35:35 the children element are ImmutableLeafSetNode 14:37:40 that's got to be a special class 14:37:41 I that is because you made the inner type of the element LeafList 14:37:42 :) 14:37:58 So you have a list of lists in your yang 14:38:22 So the LeafSetNode = LeafList which is just another type of iterable child that we need to handle. :) 14:38:49 Guys. I need to jump on my VPN. 14:38:51 Back in just a minute 14:39:51 Back 14:44:07 so its a good thing i did add leaflist as child of containerlist 14:44:22 we actually covered many cases through one example 14:46:30 Yup. :) There are more scenarios that we need to add, but you have covered the majority of them so far 14:48:14 children of leaflist is leafsetentrynode 14:48:25 another type checking 14:48:36 i will figure out all this 14:48:49 can you briefly discuss next steps 14:49:03 yes, I have a call at the top of the hour, so I have to run 14:49:05 regXboi devinavery 14:49:41 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 okay then > 14:50:09 ? 14:50:12 2) We need to get this code checked into ODL so it can be incorporated eventually into the project 14:50:25 i didn't get you 14:50:37 code checked into odl ? 14:50:40 yes 14:50:47 Ok. So we need to check all of your code into the actual Opendaylight git source control 14:51:01 which means we should do some friendly things there 14:51:12 okay ... i have to change things i guess 14:51:14 like javadoc comments 14:51:25 and a little restructuring 14:52:00 then my main question is how do we automate it ? 14:52:12 right now I would suggest a new bundle under controller/opendaylight/md-sal/ perhaps called "query" 14:52:13 like put it as a layer 14:52:39 okay 14:52:45 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 devinavery: +1 14:52:58 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 But lets start with getting your code checked into the controller and then we can go from there. 14:53:27 I think we can just say for the moment - this turns MD-SAL back into XML 14:53:38 and you can use your favorite XML tools to query it 14:53:43 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 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 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 So let me #info the next steps. 14:54:59 info or action? 14:55:02 #topic next steps 14:55:11 good point - action 14:55:26 #action Neel_B will get the list xpath code working and tests passing. 14:55:57 #action Neel_B will clean up the code by removing trailing whitespace, replacing tabs with spaces, etc 14:56:19 that thing has been done 14:56:21 perfectly 14:56:24 #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 i don't know how to write the javdoc comments 14:56:57 i never wrote for any 14:56:59 #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 #action devinavery to send some info to Neel_B with some simple examples of javadoc comments 14:58:25 #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 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 works for me 14:59:58 #link http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html Oracle java doc introduction 15:00:31 and once we have a patchset to base off of, we can add things to it 15:00:35 i guess i restructured some 15:00:44 #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 and running tests 15:01:10 Neel_B regXboi - How do these action items sound? 15:01:54 good enough 15:01:57 yes, they work for me 15:01:58 i guess 15:02:11 will have test result in a minute 15:02:39 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 #info Next meeting at the same time tomorrow (already scheduled) 15:02:58 #endmeeting