Ask Your Question

How to make my data persistence?

asked 2014-12-26 16:56:45 -0700

zhan_wu2001 gravatar image

I knew mdsal datastore support data persistence. But i still don't know how to make my data persistence? I think it's strange to make all data defined in yang? what is the persistence project goals ? git clone

edit retag flag offensive close merge delete


You can check the Toaster application for writing your data to the data store. Check the code snippet : private void setToasterStatusUp( final Function<boolean,void> resultCallback ). Get an instance of write transaction, write your object data into the appropriate data tree and submit the transaction. Supply the call back functions for the success and failure. Thanks, Srijit

Srijit Nair ( 2015-01-04 20:15:17 -0700 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-09-02 12:03:57 -0700

Colin Dixon gravatar image

You're correct that right now, the only way to store data persistently in the MD-SAL is to model it using YANG and store it in the data store. The persistence project looked at how to persist data to an external database like Cassandra, but even there some modeling was required.

Honestly, writing a YANG model is pretty simple and there are lots of people to help out. If you're looking for something simpler that works with all serializable Java classes, my guess is that you could hack something up really quickly that makes use of JPA:

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


Asked: 2014-12-26 16:56:45 -0700

Seen: 336 times

Last updated: Sep 02 '15