<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:54:41 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-922] Improve ordered list tracking</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-922</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;Our current implementation is using LinkedHashMap to track children, which is not entirely efficient, as we are forcing copies on each modification.&lt;/p&gt;

&lt;p&gt;While a trivial optimization would be to switch to copying ImmutableMaps, this is not sufficient for the purposes of &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-921&quot; title=&quot;Design insert/move operations on top of ordered (leaf-)lists&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-921&quot;&gt;YANGTOOLS-921&lt;/a&gt;, as the lists involved can become quite large and we will require some sort of snapshot handling to support the operations.&lt;/p&gt;</description>
                <environment></environment>
        <key id="31154">YANGTOOLS-922</key>
            <summary>Improve ordered list tracking</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="10003" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Confirmed</status>
                    <statusCategory id="2" key="new" colorName="blue-gray"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                    </labels>
                <created>Sun, 2 Dec 2018 17:55:58 +0000</created>
                <updated>Tue, 19 Sep 2023 16:20:40 +0000</updated>
                                                            <fixVersion>14.0.0</fixVersion>
                                    <component>data-impl</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="66613" author="rovarga" created="Mon, 25 Mar 2019 22:44:53 +0000"  >&lt;p&gt;This really boils down to defining an IndexedList interface, which aside from being a java.util.List provides:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;lookups by key, where the key may be a subset of value data&lt;/li&gt;
	&lt;li&gt;insert operation&lt;/li&gt;
	&lt;li&gt;move operation&lt;/li&gt;
	&lt;li&gt;explicit mutable transitions, similar to ModifiableMapPhase and UnmodifiableMapPhase&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Most significant problem here is maintenance of key-based indices in face of an insert/move which ends up shifting positions of the nodes. While we could have trivial secondary Map&amp;lt;Key, Integer&amp;gt;, maintaining that map would probably kill performance. It would seem that the secondary index needs to be somehow integrated with individual entries &#8211; perhaps a skip list would do the trick?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="69404" author="rovarga" created="Mon, 12 Jul 2021 20:14:34 +0000"  >&lt;p&gt;For the by-offset part we want something which behaves like a &lt;a href=&quot;https://en.wikipedia.org/wiki/Rope_(data_structure)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;rope&lt;/a&gt; generalized for not char but object storage. That should essentially take care of in-order traversal (via Iterable.iterator()) as well random access (via List.get(int)) rather easy to implement.&lt;/p&gt;

&lt;p&gt;An interesting problem here is going to be limiting fragmentation, such that we do not devolve to having a million two-item end nodes. This amounts to controlling the balance between the number of items stored and tree depth in a hypothetical&#160;&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;abstract&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;RopeNode;

&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;LeafNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; RopeNode {
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;Object&lt;/span&gt;[] values; &lt;span class=&quot;code-comment&quot;&gt;// erasure of &amp;lt;V&amp;gt;
&lt;/span&gt;}

&lt;span class=&quot;code-keyword&quot;&gt;class &lt;/span&gt;TrunkNode &lt;span class=&quot;code-keyword&quot;&gt;extends&lt;/span&gt; RopeNode {
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; leftWeight;
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; RopeNode left;
    &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; RopeNode right;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Maybe tracking depth and correlating it to something?&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="69405" author="rovarga" created="Mon, 12 Jul 2021 20:20:11 +0000"  >&lt;p&gt;In terms of supported operations, we need to support&#160; &lt;a href=&quot;https://datatracker.ietf.org/doc/html/rfc8072#section-2.5&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;YANG patch operations&lt;/a&gt; at minimum.&lt;/p&gt;</comment>
                            <comment id="69406" author="rovarga" created="Mon, 12 Jul 2021 20:31:53 +0000"  >&lt;p&gt;I am not sure about the by-key part, as it seems like it needs to point somehow to a place in the rope.&lt;/p&gt;

&lt;p&gt;I think the key realization here is that each list is a sum of edits on it, similar to what &lt;a href=&quot;https://en.wikipedia.org/wiki/Zipper_(data_structure)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;zipper&lt;/a&gt; does.&lt;/p&gt;

&lt;p&gt;A tangential thought: Xanadu&apos;s Ent is &lt;a href=&quot;https://web.archive.org/web/20071027094217/http://www.sunless-sea.net/wiki/Mark%20Miller_s%20Ent%20Class%20_a%20transcript_&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;described&lt;/a&gt; as&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;The way we get the ability to do this, in
our structure we&apos;ve got other kinds of nodes in this tree which we refer to
as DspLoafs?.  Don&apos;t worry about the derivation of the term right now.
Actually Dsp- is for displacement.  So this DspLoaf? might have in it for
instance a plus three, what that means is take all the numbers that 
you encounter navigating downward from here and consider them to 
be offset by three, and these things get accumulated so over here if
you&apos;ve got a plus seven, and then over here, the distinction, we refer to
as the split, is a four, then the split is really considered to be a 14,
so what that allows us to do is when we have the insertion point here and
you start typing, to basically rearrange the tree so that the distinction
between these two parts of the document get represented as a distinction
in the tree and then offset this part of the tree by this amount.  This
allows us to edit these large documents without bringing hardly any of
them into core.  Leaving most of them on disk untouched.&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Now this displacement calculus, along with a zipper (which would hold the effective offset?) sounds like one way to deal with edits.&lt;/p&gt;</comment>
                            <comment id="69407" author="rovarga" created="Mon, 12 Jul 2021 21:13:33 +0000"  >&lt;p&gt;I wonder whether we could get away with an offset-based reference, where we have two classes of keys:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;keys which reference the first item in a rope leaf (i.e. end node) map to a linear offset (and hence can be quickly found)&lt;/li&gt;
	&lt;li&gt;keys which reference any other item map to the key of the first item plus a linear delta&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Hence any item can be located at most through two lookups by key and one lookup by offset. This additional indirection should allow us to efficiently maintain the index, as we really need to reindex only when the shape of the leaf changes significantly, such as when a lead item is moved between leafs (or is removed). When an item is prepended into a leaf, we might get by without reindexing at the cost of additional by-key lookups.&lt;/p&gt;

&lt;p&gt;Perhaps we can use some sort of index/op counting to keep track of our worst-case lookup for a particular leaf and decide to reindex (which means N by-key replace operations where N is the number of items in the leaf).&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="69408" author="rovarga" created="Mon, 12 Jul 2021 21:28:02 +0000"  >&lt;p&gt;The modifiable phase essentially boils down to maintaining a zipper and collapsing it to a base rope/index structure.&lt;/p&gt;</comment>
                            <comment id="69409" author="vrpolak" created="Tue, 13 Jul 2021 08:56:04 +0000"  >&lt;p&gt;Does that mean we need to support access by integer offset (as list index)?&lt;/p&gt;

&lt;p&gt;The type name &quot;target-resource-offset&quot; suggest yes, but patching is only intended for configuration data, so lists always have keys (and leaf-lists are unique), and the examples use values such as &quot;6&quot; not as an offset, but as an actual string song name (key).&lt;/p&gt;

&lt;p&gt;If no, we need only access by key, which simplifies matters considerable as we no longer need to renumber offsets.&lt;/p&gt;</comment>
                            <comment id="69410" author="rovarga" created="Tue, 13 Jul 2021 09:00:46 +0000"  >&lt;p&gt;Yes, we do need that &#8211; it is implied by java.util.List.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="31153">YANGTOOLS-921</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="31152">YANGTOOLS-920</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03l8v:</customfieldvalue>

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