-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking 'uses' for Entries #96
Comments
Taken from #95: The issue is supporting the An alternative to tracking this per parent Entry (what was implemented here) is for us to rather track these in the child entries -- however, this would then be separate to where we store the contents of the when statement. We essentially would need some new way to describe these conditions - and then subsequently validate them. |
Sorry I don't quite understand what is meant by tracking in the "forward" direction. As for the tracking |
On the latter, the reason to do this on the child entries is we know whether these are subject to |
Thanks Rob, yeah that is what I was referring to. "forward" is a poor choice of words sorry Leon. To achieve what Rob is describing, I believe we'd need some form of callback function prototype or interface definition to support this, as the The alternative to this approach, would be something more like the approach used by |
I don't think we should make In my view, the intent of the original change was (as above) to allow us to store the
where Is there an argument to make Cheers, [0]: This is really expensive, and not a great idea on any large data tree instance. We have some prototypes and TODOs to fix this implementation. |
The callback I refer to is the check_condition function. I believe this has to be provided by the data store implementation if goyang is not involved in data tree considerations.
I agree there's no need for goyang to consider data itself.
…---- On Mon, 15 Apr 2019 18:10:11 -0700 [email protected] wrote ----
I don't think we should make goyang aware of the datatree. AFAICS, the approach that we've generally taken up to now is such that we make the Entry something that a downstream tool (e.g., ygot) can work with to implement validations. The ytypes library in ygot does this, and actually implements the latter type of traversal [0] that @andaru mentions.
In my view, the intent of the original change was (as above) to allow us to store the uses and augments such that when conditions could be implemented. Essentially we said:
let $e_schema be a yang.Entry that we are examining
let $e_data be a datatree node corresponding to an instance of the yang.Entry described by $e_schema
for $t in $e_schema.Uses or $e_schema.Augments:
if $t.When() != nil:
check_condition($e_schema, $t.When(), $e_data)
where check_condition would check $e_data against $e_schema using the contents of $t.When() as the condition. This seems a reasonable design to be in the downstream tool, and goyang can fill the requirements of providing $e_schema to be traversed over. The inefficiency that we've introduced, as I see it, is that we're storing Uses and Augments even when there are no when conditions on the downstream nodes. The optimisation we can likely make is simply to only store it when When would be non-nil for the Uses or Augment. We don't actually need it for when statements that are on nodes that themselves are schema tree nodes.
Is there an argument to make goyang at all aware of the implementation of $e_data? This seems like it would be required for a callback, and would rather introduce the idea of data tree validation at all into goyang which seems blurry to me.
Cheers,
r.
[0]: This is really expensive, and not a great idea on any large data tree instance. We have some prototypes and TODOs to fix this implementation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@robshakir One part that's not clear to me, is if there's no |
Absolutely, I agree that the |
I think this depends on what we decide to store in the contents of the when statement. Today, you're right that the data tree implementation needs to do some additional work to figure out what the contents of the It wasn't quite clear to me what you were asking w.r.t there being no |
Originally posted by @andaru in #95 (comment)
all: What was the original problem which led to these
uses
statements being tracked? Was the problem related to identifier namespaces or other identifier resolution issues?If so, it should be that we can avoid back-propagating the pointers to the
uses
statements by tracking those in the "forward" direction as we traverse the populated model.The text was updated successfully, but these errors were encountered: