[ https://issues.apache.org/jira/browse/KYLIN-2429?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Shaofeng SHI reassigned KYLIN-2429: ----------------------------------- Assignee: Shaofeng SHI > 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)