kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mahong...@apache.org
Subject kylin git commit: KYLIN-1297 correct LoadingCache settings
Date Fri, 08 Jan 2016 07:49:53 GMT
Repository: kylin
Updated Branches:
  refs/heads/2.0-rc 0559ae406 -> 9b0897e2f


KYLIN-1297 correct LoadingCache settings


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

Branch: refs/heads/2.0-rc
Commit: 9b0897e2fc95f6e0b1d1d77490676537e7ef354d
Parents: 0559ae4
Author: honma <honma@ebay.com>
Authored: Fri Jan 8 15:48:58 2016 +0800
Committer: honma <honma@ebay.com>
Committed: Fri Jan 8 15:49:36 2016 +0800

----------------------------------------------------------------------
 .../src/main/java/org/apache/kylin/common/KylinConfigBase.java  | 5 +++++
 .../src/main/java/org/apache/kylin/dict/DictionaryManager.java  | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/9b0897e2/core-common/src/main/java/org/apache/kylin/common/KylinConfigBase.java
----------------------------------------------------------------------
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 774d282..a5ca690 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
@@ -408,6 +408,11 @@ public class KylinConfigBase implements Serializable {
         return Integer.parseInt(getOptional("kylin.query.badquery.stacktrace.depth", "10"));
     }
 
+    public int getCachedDictMaxEntrySize() {
+        return Integer.parseInt(getOptional("kylin.dict.cache.max.entry", "3000"));
+    }
+
+
     public boolean getQueryRunLocalCoprocessor() {
         return Boolean.parseBoolean(getOptional("kylin.query.run.local.coprocessor", "false"));
     }

http://git-wip-us.apache.org/repos/asf/kylin/blob/9b0897e2/core-dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
----------------------------------------------------------------------
diff --git a/core-dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java b/core-dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
index d080d59..f2a7a87 100644
--- a/core-dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
+++ b/core-dictionary/src/main/java/org/apache/kylin/dict/DictionaryManager.java
@@ -82,7 +82,8 @@ public class DictionaryManager {
 
     private DictionaryManager(KylinConfig config) {
         this.config = config;
-        this.dictCache = CacheBuilder.newBuilder().weakValues().expireAfterWrite(10, TimeUnit.MINUTES).build(new
CacheLoader<String, DictionaryInfo>() {
+        this.dictCache = CacheBuilder.newBuilder().maximumSize(KylinConfig.getInstanceFromEnv().getCachedDictMaxEntrySize())//
+                .expireAfterWrite(1, TimeUnit.DAYS).build(new CacheLoader<String, DictionaryInfo>()
{
             @Override
             public DictionaryInfo load(String key) throws Exception {
                 DictionaryInfo dictInfo = DictionaryManager.this.load(key, true);
@@ -356,7 +357,7 @@ public class DictionaryManager {
     DictionaryInfo load(String resourcePath, boolean loadDictObj) throws IOException {
         ResourceStore store = MetadataManager.getInstance(config).getStore();
 
-        //logger.debug("Going to load DictionaryInfo from " + resourcePath);
+        logger.debug("Loading DictionaryInfo(loadDictObj:" + loadDictObj + ") from " + resourcePath);
         DictionaryInfo info = store.getResource(resourcePath, DictionaryInfo.class, loadDictObj
? DictionaryInfoSerializer.FULL_SERIALIZER : DictionaryInfoSerializer.INFO_SERIALIZER);
 
         //        if (loadDictObj)


Mime
View raw message