Ask is moving to Stack Overflow and! Please use the "opendaylight" tag on either of these sites. This site is now in Read-Only mode


Updating examples to Carbon

asked 2017-09-06 15:18:25 -0700

Sorry but this is going to be a bit of a rant...

It would be terrific if there were a few "how to" type docs with the latest ODL version (carbon) that just runs "out of the box". I find the learning curve to be needlessly steep. Many learning resources on opendaylight project are out of date. A newbie like me can find the going daunting.

Can anybody point to a small (but meaningful) "step by step" programmer guide or set of code skeletons for the latest version that the project that is the best place to get started? I find several good pages that are out of sync.

Understood that this is open source. I can contribute. How can I update wiki?



edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2017-09-09 05:54:10 -0700

VincentJahjah gravatar image

updated 2017-09-09 05:54:41 -0700

Personally, I used the l2switch project as a reference, and have stuck to the 0.6.0-SNAPSHOT version, and it has allowed me to do everything I wanted (see the activity on my profile for examples).

The Toaster examples on the MDSAL wiki pages is quite useful, and the Toaster project is itself fairly up-to-date in the current ODL repo, so I look at it sometimes for reference.

I have found that the maven imports in the Toaster projects are not (may not be) exactly working. That is why I use the l2switch project as a reference; all of the Maven imports in the 0.6.0-SNAPSHOT version work for me. And by that I mean

  1. Copy paste the parent project (l2switch version 0.6.0-SNAPSHOT, you'll have to go in the previous commits to get it)
  2. Make API/IMPL projects for each of your plugins. The IMPL should have imports to the API projects you need. The plugins should normally communicate via notifications and MDSAL storage (and perhaps RPC calls).
  3. Each of your plugins should have its own feature project in the "feature" folder. There should also be a karaf4 feature project which contains all the feature projects, as well as additional ODL features you might be interested in (like l2switch itself). Not putting these additional references means they won't be present when you boot your ODL distribution.
  4. A distribution project in "distribution/karaf" to create your odl distribution.
  5. (optional) an Artifact project to build the configs for your plugins.

My parent project's pom.xml references all of the other maven projects via the "module" tags, which means for me I can just "mvn clean install" in the parent folder and wait (about 10 minutes) for everything to compile.

I should mention that in my case, I had to export Xmx:4096m as a maven parameter because maven was running out of memory when running the features tests. Similarly, I launch my ODL distribution using

./target/assembly/bin/karaf -Xmx:4096m

from the distribution/karaf folder because installing all the ODL plugins resulted in out-of-memory exceptions in my case.

As for the Java Code, I think Toaster really gives the best examples for the most of basic use cases.

I have not found out why but some of the MDSAL objects that I use (Nodes, Node, NodeConnector) are deprecated, and I have to add a "suppressWarnings" for deprecation. This is strange, because I see no such supressWarnings in the l2switch project, which uses all of these classes. It might have to do with how I added an option to skip the checkstyle in my parent project (ODL's checkstyle is very agressive).

Takeaways: There is no straightforward solution, and no tutorial online is quite up to date. But if you do some digging and detective work by looking at the source code on the internet, you can eventually figure it out. That's exactly what I did.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-06 15:18:25 -0700

Seen: 131 times

Last updated: Sep 09 '17