kylin-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shaofeng SHI (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (KYLIN-3505) DataType.getType wrong usage of cache
Date Tue, 21 Aug 2018 10:07:00 GMT

     [ https://issues.apache.org/jira/browse/KYLIN-3505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shaofeng SHI updated KYLIN-3505:
--------------------------------
    Fix Version/s: v2.5.0
                   v2.4.1
       Issue Type: Bug  (was: Improvement)

> DataType.getType wrong usage of cache
> -------------------------------------
>
>                 Key: KYLIN-3505
>                 URL: https://issues.apache.org/jira/browse/KYLIN-3505
>             Project: Kylin
>          Issue Type: Bug
>          Components: Metadata
>            Reporter: Ian Hu
>            Assignee: Ian Hu
>            Priority: Minor
>             Fix For: v2.4.1, v2.5.0
>
>
> 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)

Mime
View raw message