You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/21 09:29:00 UTC

[jira] [Commented] (KYLIN-3505) DataType.getType wrong usage of cache

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

ASF GitHub Bot commented on KYLIN-3505:
---------------------------------------

ian4hu opened a new pull request #206: KYLIN-3505 Fix wrong usage of cache in DataType
URL: https://github.com/apache/kylin/pull/206
 
 
   Fix KYLIN-3505

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> DataType.getType wrong usage of cache
> -------------------------------------
>
>                 Key: KYLIN-3505
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3505
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Metadata
>            Reporter: Ian Hu
>            Assignee: Ian Hu
>            Priority: Minor
>
> Wrong usage of cache in org.apache.kylin.metadata.datatype.DataType#getType.
> {code:java}
> public static DataType getType(String type) {
>     if (type == null)
>         return null;
>     DataType dataType = new DataType(type); // <-- Always new
>     DataType cached = CACHE.get(dataType); // already has dataType why fetch it from cache?
>     if (cached == null) {
>         CACHE.put(dataType, dataType); // <-- Seed cache
>         cached = dataType;
>     }
>     return cached;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)