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

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

hit-lacus commented on a change in pull request #1636:
URL: https://github.com/apache/kylin/pull/1636#discussion_r639457120



##########
File path: 
kylin-spark-project/kylin-spark-engine/src/main/java/org/apache/kylin/engine/spark/job/NSparkBatchOptimizeJobCheckpointBuilder.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.kylin.engine.spark.job;
+
+import com.google.common.base.Preconditions;
+import org.apache.kylin.common.KylinConfig;
+import org.apache.kylin.cube.CubeInstance;
+import org.apache.kylin.engine.mr.steps.CubingExecutableUtil;
+import org.apache.kylin.job.constant.ExecutableConstants;
+import org.apache.kylin.job.execution.CheckpointExecutable;
+import org.apache.kylin.metadata.project.ProjectInstance;
+import org.apache.kylin.metadata.project.ProjectManager;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+
+public class NSparkBatchOptimizeJobCheckpointBuilder {
+    protected SimpleDateFormat format = new SimpleDateFormat("z yyyy-MM-dd 
HH:mm:ss", Locale.ROOT);
+
+    final protected CubeInstance cube;
+    final protected String submitter;
+
+    public NSparkBatchOptimizeJobCheckpointBuilder(CubeInstance cube, String 
submitter) {
+        this.cube = cube;
+        this.submitter = submitter;
+
+        Preconditions.checkNotNull(cube.getFirstSegment(), "Cube " + cube + " 
is empty!!!");
+    }
+
+    public CheckpointExecutable build() {
+        KylinConfig kylinConfig = cube.getConfig();
+        List<ProjectInstance> projList = 
ProjectManager.getInstance(kylinConfig).findProjects(cube.getType(),
+                cube.getName());
+        if (projList == null || projList.size() == 0) {
+            throw new RuntimeException("Cannot find the project containing the 
cube " + cube.getName() + "!!!");
+        } else if (projList.size() >= 2) {

Review comment:
       In which case, could `projList.size() >= 2` happen ?




-- 
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]


> Refresh the existing segment according to the new cuboid list in kylin4
> -----------------------------------------------------------------------
>
>                 Key: KYLIN-4966
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4966
>             Project: Kylin
>          Issue Type: New Feature
>          Components: Job Engine
>    Affects Versions: v4.0.0-beta
>            Reporter: Yaqian Zhang
>            Assignee: Yaqian Zhang
>            Priority: Minor
>             Fix For: v4.0.0-GA
>
>
> When the user wants to update the cuboid list of a cube, the existing segment 
> needs to be refreshed.



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

Reply via email to