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 2019/05/10 09:28:50 UTC
[kylin] branch 2.6.x updated: KYLIN-3995 config data type may make
oom
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
The following commit(s) were added to refs/heads/2.6.x by this push:
new 85c7388 KYLIN-3995 config data type may make oom
85c7388 is described below
commit 85c7388f2f92d907e03c537cf49ea2b42e61b94e
Author: chenzhx <ch...@apache.org>
AuthorDate: Tue May 7 16:10:31 2019 +0800
KYLIN-3995 config data type may make oom
---
.../main/java/org/apache/kylin/common/KylinConfigBase.java | 2 +-
.../org/apache/kylin/dict/TrieDictionaryForestBuilder.java | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
index 0497d1e..16a5f1b 100644
--- a/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
+++ b/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
@@ -486,7 +486,7 @@ abstract public class KylinConfigBase implements Serializable {
return Boolean.parseBoolean(getOptional("kylin.dictionary.use-forest-trie", TRUE));
}
- public int getTrieDictionaryForestMaxTrieSizeMB() {
+ public long getTrieDictionaryForestMaxTrieSizeMB() {
return Integer.parseInt(getOptional("kylin.dictionary.forest-trie-max-mb", "500"));
}
diff --git a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryForestBuilder.java b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryForestBuilder.java
index 29cff2e..10d63e1 100644
--- a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryForestBuilder.java
+++ b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryForestBuilder.java
@@ -30,7 +30,7 @@ import org.slf4j.LoggerFactory;
*/
public class TrieDictionaryForestBuilder<T> {
- public static int DEFAULT_MAX_TRIE_TREE_SIZE_MB = 500;
+ public static long DEFAULT_MAX_TRIE_TREE_SIZE_MB = 500;
private static final Logger logger = LoggerFactory.getLogger(TrieDictionaryForestBuilder.class);
@@ -52,7 +52,7 @@ public class TrieDictionaryForestBuilder<T> {
private int curOffset;
- private int maxTrieTreeSize;
+ private long maxTrieTreeSize;
private boolean isOrdered = true;
@@ -64,7 +64,7 @@ public class TrieDictionaryForestBuilder<T> {
this(bytesConverter, baseId, getMaxTrieSizeInMB());
}
- public TrieDictionaryForestBuilder(BytesConverter<T> bytesConverter, int baseId, int maxTrieTreeSizeMB) {
+ public TrieDictionaryForestBuilder(BytesConverter<T> bytesConverter, int baseId, long maxTrieTreeSizeMB) {
this.bytesConverter = bytesConverter;
this.trieBuilder = new TrieDictionaryBuilder<T>(bytesConverter);
this.baseId = baseId;
@@ -119,11 +119,11 @@ public class TrieDictionaryForestBuilder<T> {
return forest;
}
- public int getMaxTrieTreeSize() {
+ public long getMaxTrieTreeSize() {
return maxTrieTreeSize;
}
- void setMaxTrieTreeSize(int maxTrieTreeSize) {
+ void setMaxTrieTreeSize(long maxTrieTreeSize) {
this.maxTrieTreeSize = maxTrieTreeSize;
logger.info("maxTrieSize is set to:" + maxTrieTreeSize + "B");
}
@@ -154,14 +154,14 @@ public class TrieDictionaryForestBuilder<T> {
trieBuilder = new TrieDictionaryBuilder<T>(bytesConverter);
}
- public static int getMaxTrieSizeInMB() {
+ public static long getMaxTrieSizeInMB() {
KylinConfig config = null;
try {
config = KylinConfig.getInstanceFromEnv();
} catch (RuntimeException e) {
logger.info("cannot get KylinConfig from env.Use default setting:" + DEFAULT_MAX_TRIE_TREE_SIZE_MB + "MB");
}
- int maxTrieTreeSizeMB;
+ long maxTrieTreeSizeMB;
if (config != null) {
maxTrieTreeSizeMB = config.getTrieDictionaryForestMaxTrieSizeMB();
} else {