[ 
https://issues.apache.org/jira/browse/IGNITE-1783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15146622#comment-15146622
 ] 

Konstantin Margorin commented on IGNITE-1783:
---------------------------------------------

Hello.

Just want to clarify if replacing GridBoundedConcurrentLinkedHashMap with 
ConcurrentLinkedHashMap really required. It's true that 
GridBoundedConcurrentLinkedHashMap is the same as ConcurrentLinkedHashMap, but 
with different order of constructor arguments.

The value of this order is possibility to reduce number of arguments of 
constructor in some cases. Currently there are 5 places in code, where 
constructor takes only one or two arguments. If ConcurrentLinkedHashMap will be 
used in these places, each constructor will require 4 arguments. For example 
instead of:
        new GridBoundedConcurrentLinkedHashMap<>(MAX_PATH_CACHE); 
there will be:
        new ConcurrentLinkedHashMap<>(DFLT_INIT_CAP, DFLT_LOAD_FACTOR, 
DFLT_CONCUR_LVL, MAX_PATH_CACHE);

Here the list of all such places:

\org\apache\ignite\internal\processors\query\h2\IgniteH2Indexing.java
    private final GridBoundedConcurrentLinkedHashMap<T3<String, String, 
Boolean>, TwoStepCachedQuery> twoStepCache = new 
GridBoundedConcurrentLinkedHashMap<>(TWO_STEP_QRY_CACHE_SIZE);

\org\apache\ignite\internal\processors\igfs\IgfsModeResolver.java
   modesCache = new GridBoundedConcurrentLinkedHashMap<>(MAX_PATH_CACHE);
   childrenModesCache = new 
GridBoundedConcurrentLinkedHashMap<>(MAX_PATH_CACHE);

\org\apache\ignite\internal\util\GridReflectionCache.java
    private ConcurrentMap<Class, List<Field>> fields = new 
GridBoundedConcurrentLinkedHashMap<>(CACHE_SIZE, CACHE_SIZE);                   
                                                  
    private ConcurrentMap<Class, List<Method>> mtds = new 
GridBoundedConcurrentLinkedHashMap<>(    CACHE_SIZE, CACHE_SIZE);

So, the question - does replacement really make sense?

> Remove GridBoundedConcurrentLinkedHashMap and replace its usages with 
> ConcurrentLinkedHashMap
> ---------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-1783
>                 URL: https://issues.apache.org/jira/browse/IGNITE-1783
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Yakov Zhdanov
>            Assignee: Konstantin Margorin
>            Priority: Trivial
>              Labels: newbie
>
> From what I see {{GridBoundedConcurrentLinkedHashMap}} is redundant and the 
> only difference from {{ConcurrentLinkedHashMap}} is in order of constructor 
> arguments.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to