You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Pavel Tupitsyn (Jira)" <ji...@apache.org> on 2019/10/15 20:15:00 UTC
[jira] [Comment Edited] (IGNITE-6804) Print a warning if HashMap is
passed into bulk update operations
[ https://issues.apache.org/jira/browse/IGNITE-6804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16952260#comment-16952260 ]
Pavel Tupitsyn edited comment on IGNITE-6804 at 10/15/19 8:14 PM:
------------------------------------------------------------------
[~ilyak] if you add items to a new empty hashtable, the resulting order is going to be the same every time. And, I guess, this is the most common scenario (e.g. I have a list of Persons, I want to put them all to cache - I have to create and populate a Map).
This also indicates a problem with the API. We waste CPU time populating HashMap or SortedMap, when Ignite only iterates over the result, throwing away all the hash-related stuff.
Anyway, you can keep "will" if you like, but it is better to be technically correct (the best kind of correct).
was (Author: ptupitsyn):
[~ilyak] if you add items to a new empty hashtable, the resulting order is going to be the same every time. And, I guess, this is the most common scenario.
This also indicates a problem with the API. We waste CPU time populating HashMap or SortedMap, when Ignite only iterates over the result, throwing away all the hash-related stuff.
Anyway, you can keep "will" if you like, but it is better to be technically correct (the best kind of correct).
> Print a warning if HashMap is passed into bulk update operations
> ----------------------------------------------------------------
>
> Key: IGNITE-6804
> URL: https://issues.apache.org/jira/browse/IGNITE-6804
> Project: Ignite
> Issue Type: Improvement
> Components: cache
> Reporter: Denis A. Magda
> Assignee: Ilya Kasnacheev
> Priority: Critical
> Labels: usability
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Ignite newcomers tend to stumble on deadlocks simply because the keys are passed in an unordered HashMap. Propose to do the following:
> * update bulk operations Java docs.
> * print out a warning if not SortedMap (e.g. HashMap, Weak/Identity/Concurrent/Linked HashMap etc) is passed into
> a bulk method (instead of SortedMap) and contains more than 1 element. However, we should make sure that we only print that warning once and not every time the API is called.
> * do not produce warning for explicit optimistic transactions
> More details are here:
> http://apache-ignite-developers.2346864.n4.nabble.com/Re-Ignite-2-0-0-GridUnsafe-unmonitor-td23706.html
--
This message was sent by Atlassian Jira
(v8.3.4#803005)