hit-lacus commented on a change in pull request #1008: KYLIN-4227: add segment 
build callback
URL: https://github.com/apache/kylin/pull/1008#discussion_r369499209
 
 

 ##########
 File path: engine-mr/src/main/java/org/apache/kylin/engine/mr/CubingJob.java
 ##########
 @@ -257,6 +266,36 @@ void setJobType(String jobType) {
         return Pair.newPair(title, content);
     }
 
+    public void invokeCallback(ExecutableContext executableContext) {
+        try {
+            String cubeName = CubingExecutableUtil.getCubeName(getParams());
+            CubeDesc cubeDesc = 
CubeDescManager.getInstance(getConfig()).getCubeDesc(cubeName);
+            if (StringUtils.isBlank(cubeDesc.getCubeCallback())) {
+                logger.info("cubeName:" + cubeName + ", callback url is 
empty");
+                return;
+            }
+            String segmentId = CubingExecutableUtil.getSegmentId(getParams());
+            CubeSegment cubeSegment = 
CubingExecutableUtil.findSegment(executableContext, cubeName, segmentId);
+            StringBuilder sb = new StringBuilder(cubeDesc.getCubeCallback());
+            SegmentRange.TSRange tsRange = cubeSegment.getTSRange();
+            sb.append("?cube=").append(cubeName)
 
 Review comment:
   1. Hard code the url parm seems not like a good practice(I am not really 
sure), maybe it should be in more user-defined way.
   2. It is a blocking call (synchronous), will it cause build more slow when 
the endpoint is down?
   

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


With regards,
Apache Git Services

Reply via email to