You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "Shaofeng SHI (JIRA)" <ji...@apache.org> on 2017/02/14 10:11:41 UTC

[jira] [Resolved] (KYLIN-2429) Variable initialized should be declared volatile in SparkCubingByLayer#execute()

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

Shaofeng SHI resolved KYLIN-2429.
---------------------------------
    Resolution: Fixed

> Variable initialized should be declared volatile in SparkCubingByLayer#execute()
> --------------------------------------------------------------------------------
>
>                 Key: KYLIN-2429
>                 URL: https://issues.apache.org/jira/browse/KYLIN-2429
>             Project: Kylin
>          Issue Type: Bug
>    Affects Versions: v2.0.0
>            Reporter: Ted Yu
>            Assignee: Shaofeng SHI
>             Fix For: v2.0.0
>
>
> {code}
>         final JavaPairRDD<ByteArray, Object[]> encodedBaseRDD = intermediateTable.javaRDD().mapToPair(new PairFunction<Row, ByteArray, Object[]>() {
>             transient boolean initialized = false;
> ...
>             public Tuple2<ByteArray, Object[]> call(Row row) throws Exception {
>                 if (initialized == false) {
>                     synchronized (SparkCubingByLayer.class) {
>                         if (initialized == false) {
> {code}
> For double checked locking to work, initialized needs to be volatile.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)