This is an automated email from the ASF dual-hosted git repository. nic pushed a commit to branch 3.0.x in repository https://gitbox.apache.org/repos/asf/kylin.git
commit e683fff43053e368148bc20ad628cf3ef205a600 Author: nichunen <n...@apache.org> AuthorDate: Sun Jan 12 19:30:51 2020 +0800 Fix not thread-safe double-checked locking --- .../src/main/java/org/apache/kylin/measure/topn/TopNMeasureType.java | 2 +- .../kylin/stream/coordinator/coordinate/StreamingCoordinator.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 0586370..518272e 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; diff --git a/stream-coordinator/src/main/java/org/apache/kylin/stream/coordinator/coordinate/StreamingCoordinator.java b/stream-coordinator/src/main/java/org/apache/kylin/stream/coordinator/coordinate/StreamingCoordinator.java index f234c2e..20e4947 100644 --- a/stream-coordinator/src/main/java/org/apache/kylin/stream/coordinator/coordinate/StreamingCoordinator.java +++ b/stream-coordinator/src/main/java/org/apache/kylin/stream/coordinator/coordinate/StreamingCoordinator.java @@ -96,7 +96,7 @@ import com.google.common.collect.Sets; public class StreamingCoordinator implements CoordinatorClient { private static final Logger logger = LoggerFactory.getLogger(StreamingCoordinator.class); private static final int DEFAULT_PORT = 7070; - private static StreamingCoordinator instance = null; + private static volatile StreamingCoordinator instance = null; private StreamMetadataStore streamMetadataStore; private Assigner assigner;