You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Alexander Belyak (JIRA)" <ji...@apache.org> on 2017/12/19 11:58:00 UTC

[jira] [Created] (IGNITE-7246) MarshallerContextimpl.putAtIndex

Alexander Belyak created IGNITE-7246:
----------------------------------------

             Summary: MarshallerContextimpl.putAtIndex
                 Key: IGNITE-7246
                 URL: https://issues.apache.org/jira/browse/IGNITE-7246
             Project: Ignite
          Issue Type: Bug
          Components: general
    Affects Versions: 2.4
            Reporter: Alexander Belyak
            Priority: Minor


1) putAtIndex in org.apache.ignite.internal.MarshallerContextImpl contains code for unordered insertion, but it didn't work (add only into tail of allCaches collection). Test:
{panel}
    public static void main(String[] args) {
        ArrayList<ConcurrentMap<Integer, MappedName>> all = new ArrayList<>();
        ConcurrentMap<Integer, MappedName> m0 = new ConcurrentHashMap<>();
        ConcurrentMap<Integer, MappedName> m1 = new ConcurrentHashMap<>();
        putAtIndex(m1, all,(byte)1, all.size());
        putAtIndex(m0, all, (byte)0, all.size());
        System.out.println(all.get(0)==m0);
        System.out.println(all.get(1)==m1);
        System.out.println(all.size());
    }
{panel}
2) Interface Collection is unordered (javadoc: "Some are ordered and others unordered") so its better to use List interface;
3) putAtIndex called only from getCacheFor(byte) method from synchro block so it can get size of allCaches by itself



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)