You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ka...@apache.org on 2017/12/15 07:30:22 UTC
kylin git commit: KYLIN-3087 Add try catch in GlobalDictionaryBuilder
to release lock
Repository: kylin
Updated Branches:
refs/heads/master 280f6738b -> 60431f464
KYLIN-3087 Add try catch in GlobalDictionaryBuilder to release lock
Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/60431f46
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/60431f46
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/60431f46
Branch: refs/heads/master
Commit: 60431f46494aaa1297d8da87bbf49bc78312fcb4
Parents: 280f673
Author: dengfangyuan <de...@lianjia.com>
Authored: Fri Dec 15 13:28:55 2017 +0800
Committer: kangkaisen <ka...@meituan.com>
Committed: Fri Dec 15 15:29:25 2017 +0800
----------------------------------------------------------------------
.../java/org/apache/kylin/dict/GlobalDictionaryBuilder.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kylin/blob/60431f46/core-dictionary/src/main/java/org/apache/kylin/dict/GlobalDictionaryBuilder.java
----------------------------------------------------------------------
diff --git a/core-dictionary/src/main/java/org/apache/kylin/dict/GlobalDictionaryBuilder.java b/core-dictionary/src/main/java/org/apache/kylin/dict/GlobalDictionaryBuilder.java
index 8250fed..5717542 100644
--- a/core-dictionary/src/main/java/org/apache/kylin/dict/GlobalDictionaryBuilder.java
+++ b/core-dictionary/src/main/java/org/apache/kylin/dict/GlobalDictionaryBuilder.java
@@ -53,7 +53,13 @@ public class GlobalDictionaryBuilder implements IDictionaryBuilder {
hdfsDir = KylinConfig.getInstanceFromEnv().getHdfsWorkingDirectory();
}
String baseDir = hdfsDir + "resources/GlobalDict" + dictInfo.getResourceDir() + "/";
- this.builder = new AppendTrieDictionaryBuilder(baseDir, maxEntriesPerSlice, true);
+
+ try {
+ this.builder = new AppendTrieDictionaryBuilder(baseDir, maxEntriesPerSlice, true);
+ } catch (Throwable e) {
+ lock.unlock(getLockPath(sourceColumn));
+ throw new RuntimeException(String.format("Failed to create global dictionary on %s ", sourceColumn), e);
+ }
this.baseId = baseId;
}