kylin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liy...@apache.org
Subject [09/50] kylin git commit: refine stats and cubing job name (#1215)
Date Thu, 29 Jun 2017 05:48:16 GMT
refine stats and cubing job name (#1215)

* minor, refine stats job name

* minor, rename CubingJob name


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/1c3329a8
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/1c3329a8
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/1c3329a8

Branch: refs/heads/master
Commit: 1c3329a89894b0825b07d58b7dcbafd983ebc036
Parents: d659bad
Author: 成 <cheng.wang@kyligence.io>
Authored: Fri Jun 16 16:11:45 2017 +0800
Committer: luguosheng1314 <550175214@qq.com>
Committed: Fri Jun 16 16:11:45 2017 +0800

----------------------------------------------------------------------
 .../org/apache/kylin/engine/mr/CubingJob.java   | 27 +++++++++++++-------
 1 file changed, 18 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/1c3329a8/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
----------------------------------------------------------------------
diff --git a/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java b/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
index 5aa7d72..466f706 100644
--- a/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
+++ b/engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
@@ -80,11 +80,13 @@ public class CubingJob extends DefaultChainedExecutable {
     private static CubingJob initCubingJob(CubeSegment seg, String jobType, String submitter,
JobEngineConfig config) {
         KylinConfig kylinConfig = config.getConfig();
         CubeInstance cube = seg.getCubeInstance();
-        List<ProjectInstance> projList = ProjectManager.getInstance(kylinConfig).findProjects(cube.getType(),
cube.getName());
+        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) {
-            String msg = "Find more than one project containing the cube " + cube.getName()
+ ". It does't meet the uniqueness requirement!!! ";
+            String msg = "Find more than one project containing the cube " + cube.getName()
+                    + ". It does't meet the uniqueness requirement!!! ";
             if (!config.getConfig().allowCubeAppearInMultipleProjects()) {
                 throw new RuntimeException(msg);
             } else {
@@ -99,7 +101,8 @@ public class CubingJob extends DefaultChainedExecutable {
         result.setProjectName(projList.get(0).getName());
         CubingExecutableUtil.setCubeName(seg.getCubeInstance().getName(), result.getParams());
         CubingExecutableUtil.setSegmentId(seg.getUuid(), result.getParams());
-        result.setName(seg.getCubeInstance().getName() + " - " + seg.getName() + " - " +
jobType + " - " + format.format(new Date(System.currentTimeMillis())));
+        result.setName(jobType + " CUBE - " + seg.getCubeInstance().getName() + " - " + seg.getName()
+ " - "
+                + format.format(new Date(System.currentTimeMillis())));
         result.setSubmitter(submitter);
         result.setNotifyList(seg.getCubeInstance().getDescriptor().getNotifyList());
         return result;
@@ -127,11 +130,13 @@ public class CubingJob extends DefaultChainedExecutable {
 
     @Override
     protected Pair<String, String> formatNotifications(ExecutableContext context, ExecutableState
state) {
-        CubeInstance cubeInstance = CubeManager.getInstance(context.getConfig()).getCube(CubingExecutableUtil.getCubeName(this.getParams()));
+        CubeInstance cubeInstance = CubeManager.getInstance(context.getConfig())
+                .getCube(CubingExecutableUtil.getCubeName(this.getParams()));
         final Output output = getManager().getOutput(getId());
         String logMsg;
         state = output.getState();
-        if (state != ExecutableState.ERROR && !cubeInstance.getDescriptor().getStatusNeedNotify().contains(state.toString()))
{
+        if (state != ExecutableState.ERROR
+                && !cubeInstance.getDescriptor().getStatusNeedNotify().contains(state.toString()))
{
             logger.info("state:" + state + " no need to notify users");
             return null;
         }
@@ -160,7 +165,8 @@ public class CubingJob extends DefaultChainedExecutable {
         content = content.replaceAll("\\$\\{mr_waiting\\}", getMapReduceWaitTime() / 60000
+ "mins");
         content = content.replaceAll("\\$\\{last_update_time\\}", new Date(getLastModified()).toString());
         content = content.replaceAll("\\$\\{submitter\\}", StringUtil.noBlank(getSubmitter(),
"missing submitter"));
-        content = content.replaceAll("\\$\\{error_log\\}", Matcher.quoteReplacement(StringUtil.noBlank(logMsg,
"no error message")));
+        content = content.replaceAll("\\$\\{error_log\\}",
+                Matcher.quoteReplacement(StringUtil.noBlank(logMsg, "no error message")));
 
         try {
             InetAddress inetAddress = InetAddress.getLocalHost();
@@ -169,7 +175,8 @@ public class CubingJob extends DefaultChainedExecutable {
             logger.warn(e.getLocalizedMessage(), e);
         }
 
-        String title = "[" + state.toString() + "] - [" + getDeployEnvName() + "] - [" +
getProjectName() + "] - " + CubingExecutableUtil.getCubeName(this.getParams());
+        String title = "[" + state.toString() + "] - [" + getDeployEnvName() + "] - [" +
getProjectName() + "] - "
+                + CubingExecutableUtil.getCubeName(this.getParams());
 
         return Pair.of(title, content);
     }
@@ -196,7 +203,8 @@ public class CubingJob extends DefaultChainedExecutable {
      */
     @Override
     protected void handleMetaDataPersistException(Exception exception) {
-        String title = "[ERROR] - [" + getDeployEnvName() + "] - [" + getProjectName() +
"] - " + CubingExecutableUtil.getCubeName(this.getParams());
+        String title = "[ERROR] - [" + getDeployEnvName() + "] - [" + getProjectName() +
"] - "
+                + CubingExecutableUtil.getCubeName(this.getParams());
         String content = ExecutableConstants.NOTIFY_EMAIL_TEMPLATE;
         final String UNKNOWN = "UNKNOWN";
         String errMsg = null;
@@ -217,7 +225,8 @@ public class CubingJob extends DefaultChainedExecutable {
         content = content.replaceAll("\\$\\{mr_waiting\\}", UNKNOWN);
         content = content.replaceAll("\\$\\{last_update_time\\}", UNKNOWN);
         content = content.replaceAll("\\$\\{submitter\\}", StringUtil.noBlank(getSubmitter(),
"missing submitter"));
-        content = content.replaceAll("\\$\\{error_log\\}", Matcher.quoteReplacement(StringUtil.noBlank(errMsg,
"no error message")));
+        content = content.replaceAll("\\$\\{error_log\\}",
+                Matcher.quoteReplacement(StringUtil.noBlank(errMsg, "no error message")));
 
         try {
             InetAddress inetAddress = InetAddress.getLocalHost();


Mime
View raw message