[ 
https://issues.apache.org/jira/browse/KYLIN-4938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17310356#comment-17310356
 ] 

ASF GitHub Bot commented on KYLIN-4938:
---------------------------------------

Ted-Jiang commented on a change in pull request #1616:
URL: https://github.com/apache/kylin/pull/1616#discussion_r602995368



##########
File path: 
server-base/src/main/java/org/apache/kylin/rest/service/CubeService.java
##########
@@ -610,6 +610,32 @@ public CubeInstance rebuildLookupSnapshot(CubeInstance 
cube, String segmentName,
         return cube;
     }
 
+    public CubeInstance deleteSegmentById(CubeInstance cube, String uuid) 
throws IOException {
+        aclEvaluate.checkProjectWritePermission(cube);
+        Message msg = MsgPicker.getMsg();
+
+        CubeSegment toDelete = null;
+
+        toDelete = cube.getSegmentById(uuid);
+
+        if (toDelete == null) {
+            throw new BadRequestException(String.format(Locale.ROOT, 
msg.getSEG_NOT_FOUND(), uuid));
+        }
+
+        if (cube.getStatus() == RealizationStatusEnum.DISABLED
+                || (cube.getStatus() == RealizationStatusEnum.READY && 
toDelete.getStatus() != SegmentStatusEnum.READY)) {

Review comment:
       good catch!  fix.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


> remove segment by UUID 
> -----------------------
>
>                 Key: KYLIN-4938
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4938
>             Project: Kylin
>          Issue Type: New Feature
>          Components: Job Engine
>    Affects Versions: v3.1.2
>            Reporter: JiangYang
>            Assignee: JiangYang
>            Priority: Major
>             Fix For: v3.1.2
>
>
> Sometimes two segment have the same name, need remove segment by UUID .



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to