-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[fix](Export) Enhance removeOldExportJobs
Logic
#47604
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
run buildall |
TPC-H: Total hot run time: 31461 ms
|
TPC-DS: Total hot run time: 183861 ms
|
ClickBench: Total hot run time: 30.47 s
|
run buildall |
run buildall |
TPC-H: Total hot run time: 31371 ms
|
TPC-DS: Total hot run time: 182935 ms
|
ClickBench: Total hot run time: 30.3 s
|
run buildall |
TPC-H: Total hot run time: 31535 ms
|
TPC-DS: Total hot run time: 182679 ms
|
ClickBench: Total hot run time: 30.34 s
|
@@ -2547,6 +2547,10 @@ public long saveExportJob(CountingDataOutputStream dos, long checksum) throws IO | |||
long curTime = System.currentTimeMillis(); | |||
List<ExportJob> jobs = exportMgr.getJobs().stream().filter(t -> !t.isExpired(curTime)) | |||
.collect(Collectors.toList()); | |||
jobs.sort(Comparator.comparingLong(ExportJob::getCreateTimeMs)); | |||
while (jobs.size() > Config.max_export_history_job_num) { | |||
jobs.remove(0); |
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.
- only job with finished or cancelled state can be removed.
- can do sort only if
jobs.size() > Config.max_export_history_job_num
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.
done
run buildall |
TPC-H: Total hot run time: 31727 ms
|
TPC-DS: Total hot run time: 190478 ms
|
ClickBench: Total hot run time: 30.58 s
|
PR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
What problem does this PR solve?
This pull request introduces improvements to the removeOldExportJobs() method in the ExportMgr class, ensuring that it efficiently manages the number of historical export jobs based on the configured limit. The following changes have been made:
Logic Enhancement:
Unit Tests:
These changes improve the efficiency and reliability of the job management system, ensuring that it adheres to the specified constraints while providing robust testing coverage.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)