shaofengshi closed pull request #308: KYLIN-3645 clean table metadata when drop project URL: https://github.com/apache/kylin/pull/308
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java b/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java index cf37d372db..831035a678 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java +++ b/server-base/src/main/java/org/apache/kylin/rest/service/ProjectService.java @@ -24,6 +24,7 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Locale; +import java.util.Set; import javax.annotation.Nullable; @@ -69,6 +70,9 @@ @Autowired private AclEvaluate aclEvaluate; + @Autowired + private TableService tableService; + @PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN) public ProjectInstance createProject(ProjectInstance newProject) throws IOException { Message msg = MsgPicker.getMsg(); @@ -132,8 +136,11 @@ public ProjectInstance updateProject(ProjectInstance newProject, ProjectInstance @PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN) public void deleteProject(String projectName, ProjectInstance project) throws IOException { + Set<String> tables = project.getTables(); + for (String table : tables) { + tableService.unloadHiveTable(table, projectName); + } getProjectManager().dropProject(projectName); - accessService.clean(project, true); } ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services