Skip to content

Commit

Permalink
KYLIN-4064 Make param engineType working in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Wayne1c authored and nichunen committed Jul 3, 2019
1 parent 8712a87 commit 7b1927c
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public class BuildCubeWithEngine {
private CubeManager cubeManager;
private CubeDescManager cubeDescManager;
private DefaultScheduler scheduler;
protected ExecutableManager jobService;
private ExecutableManager jobService;
private static boolean fastBuildMode = false;
private static int engineType;

Expand Down Expand Up @@ -131,8 +131,6 @@ public static void beforeClass(String confDir) throws Exception {
String specifiedEngineType = System.getProperty("engineType");
if (StringUtils.isNotEmpty(specifiedEngineType)) {
engineType = Integer.parseInt(specifiedEngineType);
} else {
engineType = 2;
}

System.setProperty(KylinConfig.KYLIN_CONF, confDir);
Expand Down Expand Up @@ -195,6 +193,9 @@ public void before() throws Exception {
}

cubeDescManager = CubeDescManager.getInstance(kylinConfig);

// update enginType
updateCubeEngineType(Lists.newArrayList("ci_inner_join_cube", "ci_left_join_cube"));
}

public void after() {
Expand Down Expand Up @@ -353,12 +354,15 @@ private boolean testInnerJoinCube() throws Exception {
return doBuildAndMergeOnCube(cubeName);
}

@SuppressWarnings("unused")
private void updateCubeEngineType(String cubeName) throws IOException {
CubeDesc cubeDesc = cubeDescManager.getCubeDesc(cubeName);
if (cubeDesc.getEngineType() != engineType) {
cubeDesc.setEngineType(engineType);
cubeDescManager.updateCubeDesc(cubeDesc);
private void updateCubeEngineType(List<String> cubeNames) throws IOException {
if (engineType != 0) {
for(String cubeName : cubeNames) {
CubeDesc cubeDesc = cubeDescManager.getCubeDesc(cubeName);
if (cubeDesc.getEngineType() != engineType) {
cubeDesc.setEngineType(engineType);
cubeDescManager.updateCubeDesc(cubeDesc);
}
}
}
}

Expand Down

0 comments on commit 7b1927c

Please sign in to comment.