hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Shelukhin (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-11771) Configuration::getClassByNameOrNull synchronizes on a static object
Date Tue, 31 Mar 2015 18:18:53 GMT

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

Sergey Shelukhin commented on HADOOP-11771:
-------------------------------------------

Why don't we just stop using ReflectionUtils? 

> Configuration::getClassByNameOrNull synchronizes on a static object
> -------------------------------------------------------------------
>
>                 Key: HADOOP-11771
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11771
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: conf, io, ipc
>            Reporter: Gopal V
>         Attachments: configuration-cache-bt.png, configuration-sync-cache.png
>
>
> {code}
>   private static final Map<ClassLoader, Map<String, WeakReference<Class<?>>>>
>     CACHE_CLASSES = new WeakHashMap<ClassLoader, Map<String, WeakReference<Class<?>>>>();
> ...
>  synchronized (CACHE_CLASSES) {
>       map = CACHE_CLASSES.get(classLoader);
>       if (map == null) {
>         map = Collections.synchronizedMap(
>           new WeakHashMap<String, WeakReference<Class<?>>>());
>         CACHE_CLASSES.put(classLoader, map);
>       }
>     }
> {code}
> !configuration-sync-cache.png!
> !configuration-cache-bt.png!



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

Mime
View raw message