<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:56:20 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-1503] Disconnect NamespaceStmtCtx from Current and StmtContext</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1503</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;The two user-facing contexts expose namespace access, each of which requires resolving a NamespaceAccess &#8211; which ends up going to BuildGlobalContext.&lt;/p&gt;

&lt;p&gt;This is currently dictated by legacy class hierarchy and APIs, but we should be able to disconnect these three and passing around a NamespaceCtx:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;interface&lt;/span&gt; NamespaceCtx {
 
    &amp;lt;K, V&amp;gt; @Nullable Map&amp;lt;K, V&amp;gt; namespace(CommonStmtCtx stmt, ParserNamespace&amp;lt;K, V&amp;gt; namespace);

    &amp;lt;K, V&amp;gt; @Nullable V namespaceItem(CommonStmtCtx stmt, ParserNamespace&amp;lt;K, V&amp;gt; namespace, K key);

    &amp;lt;K, V&amp;gt; @Nullable Map&amp;lt;K, V&amp;gt; localNamespacePortion(CommonStmtCtx stmt, ParserNamespace&amp;lt;K, V&amp;gt; namespace);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;to all methods which are allowed to access namespaces.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;The reactor would implement this through BuildGlobalContext, which would mean that AbstractStorageNode would not need accessNamespace(). There are two wrinkles:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;the need to cast stmt to ReactorStmtCtx &#8211; which is essentially fine&lt;/li&gt;
	&lt;li&gt;the amount of API changes &#8211; which entails a lot of work&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="36825">YANGTOOLS-1503</key>
            <summary>Disconnect NamespaceStmtCtx from Current and StmtContext</summary>
                <type id="10100" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</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="10001">Won&apos;t Do</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Thu, 6 Apr 2023 16:22:46 +0000</created>
                <updated>Thu, 6 Apr 2023 19:52:50 +0000</updated>
                            <resolved>Thu, 6 Apr 2023 19:52:50 +0000</resolved>
                                                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="72112" author="rovarga" created="Thu, 6 Apr 2023 19:52:39 +0000"  >&lt;p&gt;Okay, so after a quick prototype, this approach is not really feasible. The issue is not user-facing, but rather reactor-internal. Passing GlobalContext around would be VERY disrupive.&lt;/p&gt;

&lt;p&gt;Another alternative would be disconnect ReactorStmtCtx from StmtContext (and others) and allocate them when we are going towards the user. That is also problematic due to three reasons:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;we have no control over retaining the object, i.e. a number of users end up storing the reference &#8211; that wrecks any attempt at reuse by itself, meaning increased GC pressure&lt;/li&gt;
	&lt;li&gt;StmtContexts are stored in namespaces &#8211; which means AbstractNamespaceStorage would have to wrap/unwrap objects as well (and detect when it needs to do so), otherwise we would be end up increasing our memory footprint&lt;/li&gt;
	&lt;li&gt;yang-parser-reactor itself needs to manipulate namespacse, which means wrapping/unwrapping would be even more awkward&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Yet another alternative would be to store BuildGlobalContext in every node &#8211; but that is just a CPU/memory trade-off, and making the templating phase just as intensive. We may retry once &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1207&quot; title=&quot;Do not populate namespaces during effective templating&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1207&quot;&gt;YANGTOOLS-1207&lt;/a&gt; is done, as that might give us a tad better tools.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                                                <inwardlinks description="is blocked by">
                                        <issuelink>
            <issuekey id="36818">YANGTOOLS-1497</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </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|i044rz:</customfieldvalue>

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