[GENIUS-76] Utilities for working more easily with asynchronous DataBroker transactions Created: 26/Apr/17  Updated: 22/Jan/20  Resolved: 22/Jan/20

Status: Verified
Project: genius
Component/s: General
Affects Version/s: (unspecified)
Fix Version/s: None

Type: Improvement
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All



 Description   

I have a feeling that most people don't really understand that the DataBroker is ideally supposed to be used asynchronously ... or if they do, it's non-trivial to see how-to in practice.

At least in genius & netvirt (I don't know about other projects), everywhere I've ever looked at it's typically always the following usual pattern, where the get() at the end turns an API which was intended to be async into a sync usage one (not to speak about the fact that at, least in the code I've come across, single new transaction per operation instead of a share transaction is the norm):

dataBroker.newReadOnlyTransaction().read(store, path).get()

whether this is done by using (my) org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker utility or (more often than not) just doing the equivalent directly in code...

As far as I understand, this hinders performance and scalability in ODL.

And we can do better relatively easily - we're just missing the right abstraction utility APIs which make it easier for people to naturally write code which does the right thing.

I'll have a go at proposing something about this. I'll intentionally start by code locally in genius only. Whether or not that code, or something later inspired by it, makes it "upstream" (controller/mdsal) is NOT in scope of this issue.



 Comments   
Comment by Michael Vorburger [ 26/Apr/17 ]

https://git.opendaylight.org/gerrit/#/c/56031/

Comment by Hema Gopalakrishnan [ 22/Jan/20 ]

This is fixed by ManagedTransactionRunner

Comment by Hema Gopalakrishnan [ 22/Jan/20 ]

Fixed

Generated at Wed Feb 07 19:59:51 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.