[MDSAL-50] Make MD-SAL Searchable Created: 03/Nov/14  Updated: 13/Jan/22

Status: Confirmed
Project: mdsal
Component/s: Binding API, Binding runtime, DOM API, DOM runtime
Affects Version/s: None
Fix Version/s: None

Type: Epic Priority: Highest
Reporter: Devin Avery Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Issue split
split to MDSAL-616 Add support for Query binding Confirmed
Epic Name: Searchable MD-SAL

 Description   

We would like to add to MD-SAL the ability to make it searchable so that users of the MD-SAL don't have to always read everything and manually search for the content they want.

Use cases:

Find me an instance of X, which has
a leaf xyz attribute definedA leaf with value abc
I.e. Find me the node which has at least one node-connector
A leaf with value abc
I.e. Find me the node with name= ‘node123'
A leaf with value != abc
Find me the node that does not have ‘openflow’ in it
A node in a child list which has value abc
Find me the node, who has a node connector, with Ipaddress “192.168.1.1"
A grandchild node which has value abc
Find me the node who has an openflow statistic ‘abc’=123
Any of the above with multiple criteria ("and" and "or" options)

give me the source termination point of link 'foo'

While not specifically raised, I could see requests coming in for the ability to search data provided on data listeners as well. With that said, I think that is OUTSIDE the scope of this milestone (and a new milestone should be added for that).

Pagination / sorting of responses came up - I believe that should be handled outside of this MILESTONE as there are benefits of that without searching.

=====
Suggested Implementations:

1) We should strongly consider using a subset of functionality of XPATH as XPath is a query language for DOM (Tree) data stores - no sense in reinventing the wheel here. It sounds like in general we can probably always return a node, vs returning individual values, but that is something we will have to experiment with as we move forward.

2) There is a suggest raised that we allow searching to happen in the datastores them selves so that we don't have to return all matching data to then search it (i.e. allow data stores to optimize the searches)

3) Even though the data store may optimize the search, some data stores may not add that capability. We should consider adding a default (initial implementation) that doesn't require data stores to search. That way we get immediate functionality compatible with all data stores. Then data stores can optimize in the future.

4) We can consider an optimization (helper) functions that allow a user to specify a root of the data tree to help filter down the initial request - in stead of starting at the true root, we could start 3 levels down a branch which could significantly impact search times.



 Comments   
Comment by Tony Tkacik [ 07/Jul/15 ]

OVSDB Usecase:

The idea is to be able to search for something using a field in the model that is not a key. For instance, the ovsdb.yang imports the network-topology and adds a Node to the datastore. The model augments the node to include ip-addresses. We would like the ability to issue a restconf query to return the node with that ip-address.

Today to do this we would implement an RPC to terminate in our backend code. Then retrieve all the Nodes in the datastore, loop over them and look for the specific matching data. We figure this is a common block of code that might be able to be implemented in the mdsal itself.

Comment by Robert Varga [ 26/Oct/20 ]

The primary use case is addressed by MDSAL-606. Preliminary equivalence tests show improvement of ~30% when the query is executed at DOM vs. equivalent search. Current implementation still traverses the entire object tree, which is subject to improvement in MDSAL-610.

Generated at Wed Feb 07 20:08:31 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.