<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:56:19 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-1497] Improve NamespaceBehaviour/NamespaceStorageNode interactions</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1497</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;As examined in &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1159&quot; title=&quot;Add GlobalParserNamespace&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1159&quot;&gt;&lt;del&gt;YANGTOOLS-1159&lt;/del&gt;&lt;/a&gt;, &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1204&quot; title=&quot;Do not subclass NamespaceBehaviour in NamespaceBehaviourWithListeners&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1204&quot;&gt;&lt;del&gt;YANGTOOLS-1204&lt;/del&gt;&lt;/a&gt; and other places, we spend a significant amount of time traversing the NamespaceStorageNode tree towards root in order to find things that are shared either on source-local, module-local or global scope.&lt;/p&gt;

&lt;p&gt;At the end of the day, for any ParserNamespace operation, we have to find its NamespaceBehaviour and then execute the request using that behaviour.&lt;/p&gt;

&lt;p&gt;There is a connection between these operations, at least in the yang-parser-reactor implementation. The story goes something like this:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;there are 4 StorageNodeTypes&lt;/li&gt;
	&lt;li&gt;we have a single baseline NamespaceStorageNode implementation (NamespaceStorageSupport), which is subclassed&lt;/li&gt;
	&lt;li&gt;there is the notion of NamespaceBehaviour.Registry, of which we have three implementations:
	&lt;ol&gt;
		&lt;li&gt;BuildGlobalContext, which also is the only StorageNodeType.GLOBAL&lt;/li&gt;
		&lt;li&gt;SourceSpecificContext, which also is the only StorageNodeType.SOURCE_LOCAL_SPECIAL&lt;/li&gt;
		&lt;li&gt;StatementSupportBundle, which seems to be quite unrelated to this problem, but has interaction with BuildGlobalContext&lt;/li&gt;
	&lt;/ol&gt;
	&lt;/li&gt;
	&lt;li&gt;StorageNodeType.ROOT_STATEMENT_LOCAL is only implemented by RootStatementContext&lt;/li&gt;
	&lt;li&gt;StorageNodeType.STATEMENT_LOCAL by all other ReactorStmtCtx subclasses&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The behaviour count breaks down as follows:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;global() has 19 references (GLOBAL node)&lt;/li&gt;
	&lt;li&gt;sourceLocal() has 6 references (SOURCE_LOCAL_SPECIAL node)&lt;/li&gt;
	&lt;li&gt;statementLocal() has 7 references (STATEMENT_LOCAL node)&lt;/li&gt;
	&lt;li&gt;rootStatementLocal() has 3 references (ROOT_STATEMENT_LOCAL node)&lt;/li&gt;
	&lt;li&gt;treeScoped() has 2 references (which means the first match node along ancestor axis)&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;The yang-parser-reactor implementation essentially requires a walk to BuildGlobalContext to acquire NamespaceBehaviours, which it wraps with extended implementations (Simple/VirtualNamespaceContext) &#8211; hence these implementations are primed to have a quick way to access the GLOBAL node. Furthermore RootStatementContext has a direct pointer to SourceSpecificContext and that has a direct pointer to BuildGlobalContext.&lt;/p&gt;

&lt;p&gt;Based on these implementation specifics, there seems to be an opportunity to knock off at least the global() case in that we would memoize BuildGlobalContext reference in NamespaceContexts &#8211; and then we just need to provide a mechanism for them to provide access to it to their respective NamespaceBehaviours.&lt;/p&gt;

&lt;p&gt;This will provide immediate benefits to major users:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;SUPPORTED_FEATURES, which is behind ReactorStmtCtx.isSupportedByFeatures()&lt;/li&gt;
	&lt;li&gt;FEATURE, which does the the same&lt;/li&gt;
	&lt;li&gt;MODULECTX_TO_QNAME, which participates on local QName construction&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;as these will not have to walk the statement tree again to reach BuildGlobalContext.&lt;/p&gt;

&lt;p&gt;While there may be other opportunities, this issue should focus on:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;disconnecting StatementSupportBundle and NamespaceBehaviour.Registry&lt;/li&gt;
	&lt;li&gt;perhaps making NamespaceBehaviour.Registry a yang-parser-reactor-internal thing&lt;/li&gt;
	&lt;li&gt;providing a way for NamespaceBehaviour.global() to receive BuildGlobalContext reference without traversing NamespaceStorageNode tree&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="36818">YANGTOOLS-1497</key>
            <summary>Improve NamespaceBehaviour/NamespaceStorageNode interactions</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="rovarga">Robert Varga</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Wed, 5 Apr 2023 19:28:22 +0000</created>
                <updated>Thu, 6 Apr 2023 16:23:28 +0000</updated>
                            <resolved>Thu, 6 Apr 2023 16:23:28 +0000</resolved>
                                                    <fixVersion>11.0.0</fixVersion>
                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                                                            <comments>
                            <comment id="72111" author="rovarga" created="Thu, 6 Apr 2023 13:53:18 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1204&quot; title=&quot;Do not subclass NamespaceBehaviour in NamespaceBehaviourWithListeners&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1204&quot;&gt;&lt;del&gt;YANGTOOLS-1204&lt;/del&gt;&lt;/a&gt; is part of the picture here, as that revolves around yang-parser-reactor&apos;s coupling to NamespaceBehaviour. Once we have addressed it we have a convenient place where we can store the reference to BuildGlobalContext.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="36825">YANGTOOLS-1503</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                                                <inwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="33728">YANGTOOLS-1204</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                            <subtask id="36819">YANGTOOLS-1498</subtask>
                            <subtask id="36820">YANGTOOLS-1499</subtask>
                            <subtask id="36822">YANGTOOLS-1501</subtask>
                            <subtask id="36821">YANGTOOLS-1500</subtask>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10002" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>YANGTOOLS-652</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i044qf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>