You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2020/02/07 07:40:29 UTC

[kylin] 05/05: Fix not thread-safe double-checked locking

This is an automated email from the ASF dual-hosted git repository.

nic pushed a commit to branch 2.6.x
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 9e3533865788beec74fe060d6cdc8992c6142dc4
Author: nichunen <ni...@apache.org>
AuthorDate: Fri Feb 7 15:39:08 2020 +0800

    Fix not thread-safe double-checked locking
---
 .../src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
index 472de3c..ce136ea 100644
--- a/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
+++ b/core-metadata/src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java
@@ -129,7 +129,7 @@ public class TopNMeasureType extends MeasureType<TopNCounter<ByteArray>> {
             private List<TblColRef> literalCols = null;
             private int keyLength = 0;
 
-            private DimensionEncoding[] newDimensionEncodings = null;
+            private volatile DimensionEncoding[] newDimensionEncodings = null;
             private int newKeyLength = 0;
             private boolean needReEncode = true;