You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2016/10/10 13:54:16 UTC

[02/12] kylin git commit: minor, a cautious check in TrieDictionaryBuilder

minor, a cautious check in TrieDictionaryBuilder


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2abf2d33
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2abf2d33
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2abf2d33

Branch: refs/heads/yang21-hbase1.x
Commit: 2abf2d33a1f23e0a6ef12eb40a75b04d67b11c5f
Parents: 8aa91eb
Author: Yang Li <li...@apache.org>
Authored: Fri Oct 7 12:39:09 2016 +0800
Committer: Yang Li <li...@apache.org>
Committed: Fri Oct 7 12:39:09 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/2abf2d33/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
----------------------------------------------------------------------
diff --git a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
index 1271483..94dd208 100644
--- a/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
+++ b/core-dictionary/src/main/java/org/apache/kylin/dict/TrieDictionaryBuilder.java
@@ -417,6 +417,8 @@ public class TrieDictionaryBuilder<T> {
         int sizeNoValuesBeneath = stats.mbpn_sizeNoValueBeneath;
         int sizeChildOffset = stats.mbpn_sizeChildOffset;
         
+        if (stats.mbpn_footprint <= 0) // must never happen, but let us be cautious
+            throw new IllegalStateException("Too big dictionary, dictionary cannot be bigger than 2GB");
         if (stats.mbpn_footprint > _2GB)
             throw new RuntimeException("Too big dictionary, dictionary cannot be bigger than 2GB");