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 2020/07/01 08:31:50 UTC
[kylin] 08/41: KYLIN-4536 Make the stats for current cuboids
consistent with the ones for recommend cuboids
This is an automated email from the ASF dual-hosted git repository.
nju_yaho pushed a commit to tag ebay-3.1.0-release-20200701
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 8a0567e47528b63db4de01308a56efa801e66c4e
Author: Zhong, Yanghong <nj...@apache.org>
AuthorDate: Wed May 27 17:15:10 2020 +0800
KYLIN-4536 Make the stats for current cuboids consistent with the ones for recommend cuboids
---
.../java/org/apache/kylin/rest/controller/CubeController.java | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
index 1b5f1e4..d237002 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/controller/CubeController.java
@@ -902,12 +902,11 @@ public class CubeController extends BasicController {
public CuboidTreeResponse getCurrentCuboids(@PathVariable String cubeName) {
checkCubeExists(cubeName);
CubeInstance cube = cubeService.getCubeManager().getCube(cubeName);
+
// The cuboid tree displayed should be consistent with the current one
CuboidScheduler cuboidScheduler = cube.getCuboidScheduler();
- Map<Long, Long> cuboidStatsMap = cube.getCuboids();
- if (cuboidStatsMap == null) {
- cuboidStatsMap = CuboidStatsReaderUtil.readCuboidStatsFromCube(cuboidScheduler.getAllCuboidIds(), cube);
- }
+ Set<Long> currentCuboidSet = cuboidScheduler.getAllCuboidIds();
+ Map<Long, Long> cuboidStatsMap = CuboidStatsReaderUtil.readCuboidStatsFromCube(currentCuboidSet, cube);
Map<Long, Long> hitFrequencyMap = null;
Map<Long, Long> queryMatchMap = null;
@@ -918,7 +917,6 @@ public class CubeController extends BasicController {
logger.warn("Fail to query on system cube due to " + e);
}
- Set<Long> currentCuboidSet = cube.getCuboidScheduler().getAllCuboidIds();
return cubeService.getCuboidTreeResponse(cuboidScheduler, cuboidStatsMap, hitFrequencyMap, queryMatchMap,
currentCuboidSet);
}