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



##########
File path: 
server-base/src/main/java/org/apache/kylin/rest/controller/JobController.java
##########
@@ -160,17 +168,41 @@ public JobInstance get(@PathVariable String jobId) {
      * @return
      * @throws IOException
      */
+
     @RequestMapping(value = "/{jobId}/steps/{stepId}/output", method = { 
RequestMethod.GET }, produces = {
             "application/json" })
     @ResponseBody
     public Map<String, String> getStepOutput(@PathVariable String jobId, 
@PathVariable String stepId) {
         Map<String, String> result = new HashMap<String, String>();
         result.put("jobId", jobId);
         result.put("stepId", String.valueOf(stepId));
-        result.put("cmd_output", 
jobService.getExecutableManager().getOutput(stepId).getVerboseMsg());
+        result.put("cmd_output", jobService.getJobOutput(jobId, stepId));
         return result;
     }
 
+    /**
+     * Download a job step output from hdfs
+     * @param jobId
+     * @param stepId
+     * @param project
+     * @param response
+     * @return
+     */
+    @RequestMapping(value = "/{job_id:.+}/steps/{step_id:.+}/log", method = { 
RequestMethod.GET }, produces = { "application/json" })
+    @ResponseBody
+    public EnvelopeResponse<String> downloadLogFile(@PathVariable("job_id") 
String jobId,
+                                                    @PathVariable("step_id") 
String stepId, @RequestParam(value = "project") String project,
+                                                    HttpServletResponse 
response) throws IOException {
+        checkRequiredArg("job_id", jobId);
+        checkRequiredArg("step_id", stepId);
+        checkRequiredArg("project", project);
+        String downloadFilename = String.format(Locale.ROOT, "%s_%s.log", 
project, stepId);

Review comment:
       Before combine `project` with `stepId`, please check if it is vaild and 
remove any illegal character.




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


Reply via email to