You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kylin.apache.org by "Ted Yu (JIRA)" <ji...@apache.org> on 2017/02/06 19:26:41 UTC
[jira] [Created] (KYLIN-2429) Variable initialized should be
declared volatile in SparkCubingByLayer#execute()
Ted Yu created KYLIN-2429:
-----------------------------
Summary: 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
Reporter: Ted Yu
{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)