You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The existing tedge_api::entity_store::EntityStore impl doesn't have any APIs to remove an entity, along with its children from the entity store. Implementing is also not trivial as the entities are currently stored in a HashMap and retrieving all the children of a given entity would involve multiple iterations over the entire map looking for each @parent, which isn't efficient.
Describe the solution you'd like
Add a function with the following signature that accepts the topic id of the parent entity to be removed, along with its children, and returns the list of all the entities that were removed:
To make the retrieval of the child tree more efficient, a tree of EntityTopicIds can also be maintained along with the HashMap, which can further be used in the deregsiter API implementation. The same tree structure can be used to support search APIs to be added in future, to fetch things like all immediate child devices of a given device, all services of a given device etc.
The text was updated successfully, but these errors were encountered:
albinsuresh
added
the
idea
ideas/opportunities/feature requests which need to be further investigated before implementation
label
Nov 6, 2024
Is your feature request related to a problem? Please describe.
The existing
tedge_api::entity_store::EntityStore
impl doesn't have any APIs to remove an entity, along with its children from the entity store. Implementing is also not trivial as the entities are currently stored in aHashMap
and retrieving all the children of a given entity would involve multiple iterations over the entire map looking for each@parent
, which isn't efficient.Describe the solution you'd like
Add a function with the following signature that accepts the topic id of the parent entity to be removed, along with its children, and returns the list of all the entities that were removed:
deregister(topic_id: &EntityTopicId) -> Result<Vec<EntityTopicId>, Error>
To make the retrieval of the child tree more efficient, a tree of
EntityTopicId
s can also be maintained along with theHashMap
, which can further be used in thederegsiter
API implementation. The same tree structure can be used to supportsearch
APIs to be added in future, to fetch things like all immediate child devices of a given device, all services of a given device etc.The text was updated successfully, but these errors were encountered: