Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.1.17]ECM Support file download #318

Merged
merged 5 commits into from
Nov 1, 2023

Conversation

v-kkhuang
Copy link

@v-kkhuang v-kkhuang commented Oct 23, 2023

What is the purpose of the change

ECM Support file download

Related issues/PRs

Related issues: apache#4949

Brief change log

  • Define the core abstraction and interfaces of the EngineConn Factory;
  • Define the core abstraction and interfaces of Executor Manager.

Checklist

  • I have read the Contributing Guidelines on pull requests.
  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the Linkis mailing list first)
  • If this is a code change: I have written unit tests to fully verify the new behavior.

private final Logger logger = LoggerFactory.getLogger(ECMRestfulApi.class);

@RequestMapping(path = "/downloadEngineLog", method = RequestMethod.POST)
public void downloadEngineLog(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add swagger annotation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

logger.error("download failed", e);
response.reset();
response.setCharacterEncoding(Consts.UTF_8.toString());
response.setContentType("text/plain; charset=utf-8");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add header content-length

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -33,7 +33,8 @@ public enum EngineconnServerErrorCodeSummary implements LinkisErrorCode {
11110,
"the parameters of engineConnInstance and ticketId are both not exists.(engineConnInstance 和ticketId 的参数都不存在.)"),
LOG_IS_NOT_EXISTS(11110, "Log directory {0} does not exists.(日志目录 {0} 不存在.)"),
FAILED_TO_DOWNLOAD(911115, "failed to downLoad(下载失败)");
FAILED_TO_DOWNLOAD(911115, "failed to downLoad(下载失败)"),
FILE_IS_OVERSIZE(911116, "Download file has exceeded 100MB(下载文件已经超过100M)");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 FILE_IS_OVERSIZE(911116, "Download file size has exceeded 100MB(下载文件已超过100M)");

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@casionone casionone changed the title 【wip】【1.1.17】ECM Support file download [wip][1.1.17]ECM Support file download Oct 23, 2023
@v-kkhuang v-kkhuang changed the title [wip][1.1.17]ECM Support file download [1.1.17]ECM Support file download Oct 25, 2023
@v-kkhuang v-kkhuang changed the base branch from dev-1.1.16-webank to dev-1.1.17-webank October 25, 2023 07:46
response.addHeader(
"Content-Disposition",
"attachment;filename=" + instance.replace(":", "_") + "_" + logType + ".txt");
response.addHeader("Content-Length", fileSizeInBytes + "");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add annotation for filename example
// filename eg:xxxxx
val filename= instance.replace(":", "") + "" + logType + ".txt"
.....

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@casionone casionone merged commit 8a36b86 into dev-1.1.17-webank Nov 1, 2023
7 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants