You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by nj...@apache.org on 2018/12/19 03:49:26 UTC

[kylin] branch master updated: KYLIN-3544 refine guava cache for the recommended cuboids of cube planner

This is an automated email from the ASF dual-hosted git repository.

nju_yaho pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new af77cfa  KYLIN-3544 refine guava cache for the recommended cuboids of cube planner
af77cfa is described below

commit af77cfa28b5f2b47b57dce71b00f69115275748c
Author: kyotoYaho <nj...@apache.org>
AuthorDate: Wed Dec 19 11:48:57 2018 +0800

    KYLIN-3544 refine guava cache for the recommended cuboids of cube planner
---
 .../kylin/cube/cuboid/algorithm/CuboidRecommender.java      | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/CuboidRecommender.java b/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/CuboidRecommender.java
index 54c6764..baacb51 100644
--- a/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/CuboidRecommender.java
+++ b/core-cube/src/main/java/org/apache/kylin/cube/cuboid/algorithm/CuboidRecommender.java
@@ -46,7 +46,7 @@ public class CuboidRecommender {
             .removalListener(new RemovalListener<String, Map<Long, Long>>() {
                 @Override
                 public void onRemoval(RemovalNotification<String, Map<Long, Long>> notification) {
-                    logger.info("Dict with resource path " + notification.getKey() + " is removed due to "
+                    logger.info("Recommended cuboids for cube " + notification.getKey() + " is removed due to "
                             + notification.getCause());
                 }
             }).maximumSize(KylinConfig.getInstanceFromEnv().getCubePlannerRecommendCuboidCacheMaxSize())
@@ -66,8 +66,8 @@ public class CuboidRecommender {
     }
 
     public CuboidRecommender() {
-        Broadcaster.getInstance(KylinConfig.getInstanceFromEnv()).registerListener(new CuboidRecommenderSyncListener(),
-                "cube");
+        Broadcaster.getInstance(KylinConfig.getInstanceFromEnv())
+                .registerStaticListener(new CuboidRecommenderSyncListener(), "cube", "cube_desc");
     }
 
     private static CuboidRecommender instance = new CuboidRecommender();
@@ -94,8 +94,7 @@ public class CuboidRecommender {
                         Map<Long, Long> emptyMap = Maps.newHashMap();
                         cuboidRecommendCache.put(key, emptyMap);
                         try {
-                            Map<Long, Long> recommendCuboid = getRecommendCuboidList(cuboidStats, kylinConfig,
-                                    true);
+                            Map<Long, Long> recommendCuboid = getRecommendCuboidList(cuboidStats, kylinConfig, true);
 
                             if (recommendCuboid != null) {
                                 logger.info(String.format(Locale.ROOT, "Add recommend cuboids for %s to cache", key));
@@ -105,7 +104,9 @@ public class CuboidRecommender {
                             return recommendCuboid;
                         } catch (Exception e) {
                             cuboidRecommendCache.invalidate(key);
-                            logger.error(String.format(Locale.ROOT, "Failed to get recommend cuboids for %s in cache", key), e);
+                            logger.error(
+                                    String.format(Locale.ROOT, "Failed to get recommend cuboids for %s in cache", key),
+                                    e);
                             throw e;
                         }
                     }