You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by ni...@apache.org on 2019/07/11 15:49:25 UTC

[kylin] 02/02: KYLIN-4005 Code review

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

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

commit f17664c168315035bec878066275054a6b4576d9
Author: nichunen <ni...@apache.org>
AuthorDate: Thu Jul 11 15:33:13 2019 +0800

    KYLIN-4005 Code review
---
 .../apache/kylin/cube/cuboid/CuboidSchedulerTest.java | 19 +++++++++++--------
 ..._dim_five_cap.json => fifty_dim_five_cap.json.bad} |  0
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidSchedulerTest.java b/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidSchedulerTest.java
index aac1497..5abb462 100644
--- a/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidSchedulerTest.java
+++ b/core-cube/src/test/java/org/apache/kylin/cube/cuboid/CuboidSchedulerTest.java
@@ -35,6 +35,7 @@ import org.apache.kylin.cube.model.CubeDesc;
 import org.apache.kylin.cube.model.validation.ValidateContext;
 import org.apache.kylin.cube.model.validation.rule.AggregationGroupRule;
 import org.junit.After;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -95,8 +96,13 @@ public class CuboidSchedulerTest extends LocalFileMetadataTestCase {
     private CubeDesc getFiftyDimCubeDesc() {
         return getCubeDescManager().getCubeDesc("fifty_dim");
     }
+
     private CubeDesc getFiftyDimFiveCapCubeDesc() {
-        return getCubeDescManager().getCubeDesc("fifty_dim_five_cap");
+        File metaFile = new File(LocalFileMetadataTestCase.LOCALMETA_TEMP_DATA, "cube_desc/fifty_dim_five_cap.json.bad");
+        assertTrue(metaFile.exists());
+        String path = metaFile.getPath();
+        metaFile.renameTo(new File(path.substring(0, path.length() - 4)));
+        return CubeDescManager.getInstance(getTestConfig()).getCubeDesc("fifty_dim_five_cap");
     }
 
     private CubeDesc getTwentyDimCubeDesc() {
@@ -319,19 +325,16 @@ public class CuboidSchedulerTest extends LocalFileMetadataTestCase {
 
     @Test
     public void testTooLargeCube() {
-        CubeDesc cube = getFiftyDimFiveCapCubeDesc();
+        CubeDesc cubeDesc = getFiftyDimFiveCapCubeDesc();
         AggregationGroupRule rule = new AggregationGroupRule();
         ValidateContext context = new ValidateContext();
-        rule.validate(cube, context);
+        rule.validate(cubeDesc, context);
         assertFalse(context.ifPass());
         assertEquals(1, context.getResults().length);
 
         try {
-            CuboidScheduler cuboidScheduler = cube.getInitialCuboidScheduler();
-            long start = System.currentTimeMillis();
-            System.out.println(cuboidScheduler.getCuboidCount());
-            System.out.println("build tree takes: " + (System.currentTimeMillis() - start) + "ms");
-            assertTrue("Never be here", false);
+            cubeDesc.getInitialCuboidScheduler();
+            Assert.fail();
         } catch (RuntimeException e) {
         }
     }
diff --git a/examples/test_case_data/localmeta/cube_desc/fifty_dim_five_cap.json b/examples/test_case_data/localmeta/cube_desc/fifty_dim_five_cap.json.bad
similarity index 100%
rename from examples/test_case_data/localmeta/cube_desc/fifty_dim_five_cap.json
rename to examples/test_case_data/localmeta/cube_desc/fifty_dim_five_cap.json.bad