[fix](load) Recycle progress before removing bulk load job (#29066)
This commit is contained in:
@ -336,6 +336,11 @@ public abstract class BulkLoadJob extends LoadJob {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void recycleProgress() {
|
||||
// Recycle memory occupied by Progress.
|
||||
Env.getCurrentProgressManager().removeProgress(String.valueOf(id));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void auditFinishedLoadJob() {
|
||||
try {
|
||||
|
||||
@ -421,6 +421,9 @@ public class LoadManager implements Writable {
|
||||
if (job instanceof SparkLoadJob) {
|
||||
((SparkLoadJob) job).clearSparkLauncherLog();
|
||||
}
|
||||
if (job instanceof BulkLoadJob) {
|
||||
((BulkLoadJob) job).recycleProgress();
|
||||
}
|
||||
if (list.isEmpty()) {
|
||||
map.remove(job.getLabel());
|
||||
}
|
||||
@ -745,6 +748,9 @@ public class LoadManager implements Writable {
|
||||
if (!job.isCompleted()) {
|
||||
continue;
|
||||
}
|
||||
if (job instanceof BulkLoadJob) {
|
||||
((BulkLoadJob) job).recycleProgress();
|
||||
}
|
||||
innerIter.remove();
|
||||
idToLoadJob.remove(job.getId());
|
||||
++counter;
|
||||
@ -765,6 +771,9 @@ public class LoadManager implements Writable {
|
||||
if (!job.isCompleted()) {
|
||||
continue;
|
||||
}
|
||||
if (job instanceof BulkLoadJob) {
|
||||
((BulkLoadJob) job).recycleProgress();
|
||||
}
|
||||
iter.remove();
|
||||
idToLoadJob.remove(job.getId());
|
||||
++counter;
|
||||
|
||||
@ -45,6 +45,10 @@ public class ProgressManager {
|
||||
registerProgress(id, 0);
|
||||
}
|
||||
|
||||
public void removeProgress(String id) {
|
||||
idToProgress.remove(id);
|
||||
}
|
||||
|
||||
public void updateProgress(String id, TUniqueId queryId, TUniqueId fragmentId, int finishedScannerNum) {
|
||||
Progress progress = idToProgress.get(id);
|
||||
if (progress != null) {
|
||||
|
||||
Reference in New Issue
Block a user