-
Notifications
You must be signed in to change notification settings - Fork 203
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
perf: 本地文件准备过程优化 #2611 #2612
perf: 本地文件准备过程优化 #2611 #2612
Conversation
jsonwan
commented
Nov 11, 2023
- 处理traceId断链问题;
- 优化日志,重构部分代码;
- 支持发布过程中文件准备过程取消后重新准备文件。
1. 处理traceId断链问题; 2. 优化日志,重构部分代码。
1. 支持发布过程中文件准备过程取消后重新准备文件; 2. 修复StopTask中traceId断链问题。
1. 修复重新准备文件导致的多条任务记录查询报错问题。
1. 第三方文件源临时文件清理优化。
@@ -93,18 +80,21 @@ public void saveFileSourceTaskLog(FileSourceTaskLogDTO fileSourceTaskLog) { | |||
.set(t.START_TIME, fileSourceTaskLog.getStartTime()) | |||
.set(t.END_TIME, fileSourceTaskLog.getEndTime()) | |||
.set(t.TOTAL_TIME, fileSourceTaskLog.getTotalTime()) | |||
.set(t.STATUS, JooqDataTypeUtil.toByte(fileSourceTaskLog.getStatus())).set(t.FILE_SOURCE_BATCH_TASK_ID, fileSourceTaskLog.getFileSourceBatchTaskId()) | |||
.set(t.STATUS, JooqDataTypeUtil.toByte(fileSourceTaskLog.getStatus())).set(t.FILE_SOURCE_BATCH_TASK_ID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换行格式不对
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
.execute(); | ||
} | ||
|
||
@Override | ||
public FileSourceTaskLogDTO getFileSourceTaskLog(long stepInstanceId, int executeCount) { | ||
public FileSourceTaskLogDTO getLatestFileSourceTaskLog(long stepInstanceId, int executeCount) { | ||
FileSourceTaskLog t = FileSourceTaskLog.FILE_SOURCE_TASK_LOG; | ||
Record record = defaultContext.select(t.STEP_INSTANCE_ID, t.EXECUTE_COUNT, t.START_TIME, t.END_TIME, | ||
t.TOTAL_TIME, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
换行格式有点问题
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
@@ -144,6 +144,10 @@ public void checkVolumeAndClear() { | |||
private void doCheckVolumeAndClear() { | |||
long maxSizeBytes = workerConfig.getMaxSizeGB() * 1024L * 1024L * 1024L; | |||
File workDirFile = new File(workerConfig.getWorkspaceDirPath()); | |||
if (!workDirFile.exists()) { | |||
log.debug("Workspace({}) not exists yet, ignore clear", workerConfig.getWorkspaceDirPath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug 日志需要加上 isDebugEnable 判断
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
@@ -139,6 +139,9 @@ public void handleEvent(StepEvent stepEvent, | |||
case CONTINUE_FILE_PUSH: | |||
continueGseFileStep(stepInstance); | |||
break; | |||
case PREPARE_FILE_AGAIN: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PREPARE_FILE_AGAIN 命名有点奇怪。执行引擎的事件都应该是幂等的,这里不需要加上 AGAIN, 与其它地方不统一。 建议改成 PREPARE_FILE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
FileSourceTaskLog t = FileSourceTaskLog.FILE_SOURCE_TASK_LOG; | ||
Record record = defaultContext.select(t.STEP_INSTANCE_ID, t.EXECUTE_COUNT, t.START_TIME, t.END_TIME, | ||
t.TOTAL_TIME, | ||
t.STATUS, t.FILE_SOURCE_BATCH_TASK_ID).from(t) | ||
.where(t.STEP_INSTANCE_ID.eq(stepInstanceId)) | ||
.and(t.EXECUTE_COUNT.eq(executeCount)) | ||
.orderBy(t.ID.desc()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
逻辑上有问题,依赖了主键自增长的条件。后续分库分表改造之后,使用分布式自增长主键就没法保证这种连续性了。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
@@ -139,6 +139,9 @@ public void handleEvent(StepEvent stepEvent, | |||
case CONTINUE_FILE_PUSH: | |||
continueGseFileStep(stepInstance); | |||
break; | |||
case PREPARE_FILE: | |||
prepareFileAgain(stepInstance); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
方法名需要修改为 prepareFile(), 与 action 对应起来
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
* | ||
* @param stepInstance 步骤实例 | ||
*/ | ||
private void prepareFileAgain(StepInstanceDTO stepInstance) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
方法名需要修改为 prepareFile(), 与 action 对应起来。注释需要改成"准备要分发的文件"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改
处理Review意见。
c198f68
to
5ff450e
Compare