[YANGTOOLS-784] Defer statement initialization in InferredStatementContext Created: 07/Jun/17  Updated: 10/Apr/22  Resolved: 03/Dec/20

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0

Type: Improvement Priority: Highest
Reporter: Robert Varga Assignee: Miroslav Kovac
Resolution: Done Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
blocks YANGTOOLS-694 Eliminate duplicate DescriptionEffect... Resolved
is blocked by YANGTOOLS-1155 Reactor may fail if listeners fire re... Resolved
Relates
relates to YANGTOOLS-956 Augment of mandatory leaf not allowed... Resolved
Sub-Tasks:
Key
Summary
Type
Status
Assignee
YANGTOOLS-1154 Centralize ChildSchemaNodeNamespace p... Sub-task Resolved Miroslav Kovac  
YANGTOOLS-1156 InferredStatementContext.isConfigurat... Sub-task Resolved Miroslav Kovac  
YANGTOOLS-1157 Add StmtContext.findSubstatementArgum... Sub-task Resolved Miroslav Kovac  
YANGTOOLS-1160 Improve InferredStatementContext on-d... Sub-task Resolved Miroslav Kovac  
YANGTOOLS-1161 Reformulate StatementContextFactory.c... Sub-task Resolved Miroslav Kovac  
YANGTOOLS-1162 Eliminate parser.rfc7950.stmt.Abstrac... Sub-task Resolved Michal Banik  
YANGTOOLS-1184 Release InferredStatementContext's ef... Sub-task Resolved Robert Varga  
YANGTOOLS-1185 Integrate EffectiveStmtCtx and StmtCo... Sub-task Resolved Miroslav Kovac  
Epic Link: Parser Performance

 Description   

In order to implement efficient grouping inlining with working augment/deviate statements, we need to have the concept of a node which represents a tree of potential nodes. This cannot be realized via internals of parser.stmt.reactor because it changes the mechanics of how NamespaceBehaviours work.

Current design assumption is that namespaces are populated eagerly with key/value pairs and inference actions can be registered to respond to those key/values.

Efficient inlining (YANGTOOLS-694) requires that not all nodes are instantiated, which would lead to under-populated namespaces and listeners not triggering, all of which is centered about StmtContext and StmtContext.Mutable.

Currently the only use of listeners is to perform mutation, which simplifies the contract, as we really need to have a way to:

  • understand that a node represents a tree (and is otherwise a StmtContext.Mutable)
  • understand that a listener is interested in some of its children
  • request such a node to give us a StmtContext.Mutable representation of its specific child (potentially again a MutableTree)

Further simplification comes from the fact that we need this to work only in one specific namespace, which is ChildSchemaNodeNamespace.



 Comments   
Comment by Robert Varga [ 15/Jan/20 ]

Note the FIXME guidance provided is not completely accurate – those methods do not have to become arguments to buildEffective(), but can be properly intercepted by a forwarding StmtContext passed in by the caller (which would be the MutableTree implementation).

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