Skip to content

Implement config search for the MetaDB#644

Draft
amrc-benmorrow wants to merge 6 commits into
mainfrom
bmz/metadb-find
Draft

Implement config search for the MetaDB#644
amrc-benmorrow wants to merge 6 commits into
mainfrom
bmz/metadb-find

Conversation

@amrc-benmorrow
Copy link
Copy Markdown
Contributor

This PR makes changes which are currently incompatible with the ConfigDB.
Do not merge until this is resolved.

  • Implement v2/app/{app}/find endpoint on the MetaDB to search for an object with a specific config. Unlike the v1 search endpoint this does an exact match with no fuzzy lookup.
  • Implement v2/app/{app}/class/{class}/find to search within a class.
  • Adapt the ServiceClient ConfigDB.resolve method to use the new endpoints. This will not work against the ConfigDB until the ConfigDB supports the new endpoints.
  • Make Sparkplug Node and Edge cluster subclasses of Sparkplug entity. This is necessary for the MetaDB to recognise that objects of these classes may have Sparkplug addresses.

Note that this endpoint is not implemented by either ConfigDB or MetaDB
yet.

Maintain compatibility within the `resolve` method, which is the only
current use of the search interface. The compatibility is not exact but
is good enough to cover existing use cases where jsonpath is not used
and exact matches are what we want.
So far we have only implemented config entry endpoints. The app-level
endpoints such as listing objects are not implemented yet.
This does a simpleminded search over the current app state. This will be
significantly less efficient than a dedicated query for a single use,
but may be more efficient in situations where only a few Apps are being
queried, especially if those Apps are also the subjects of notify
sequences. The simpleminded approach also avoids issues of JSON
canonicalisation.
In order for the MetaDB to recognise that objects of these may have
Sparkplug addresses it is necessary for them to be subclasses of
SparkplugEntity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant