[improve](restore) Release useless info for the finished job to reduce mem usage (#34513)
This commit is contained in:
@ -788,6 +788,20 @@ public class BackupJobInfo implements Writable {
|
||||
return getBrief();
|
||||
}
|
||||
|
||||
public void releaseSnapshotInfo() {
|
||||
tabletBeMap.clear();
|
||||
tabletSnapshotPathMap.clear();
|
||||
for (BackupOlapTableInfo tableInfo : backupOlapTableObjects.values()) {
|
||||
for (BackupPartitionInfo partInfo : tableInfo.partitions.values()) {
|
||||
for (BackupIndexInfo indexInfo : partInfo.indexes.values()) {
|
||||
for (BackupTabletInfo tabletInfo : indexInfo.sortedTabletInfoList) {
|
||||
tabletInfo.files.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static BackupJobInfo read(DataInput in) throws IOException {
|
||||
return BackupJobInfo.readFields(in);
|
||||
}
|
||||
|
||||
@ -156,6 +156,11 @@ public class RestoreFileMapping implements Writable {
|
||||
return mapping;
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
mapping.clear();
|
||||
overwriteMap.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(DataOutput out) throws IOException {
|
||||
out.writeInt(mapping.size());
|
||||
|
||||
@ -1801,6 +1801,8 @@ public class RestoreJob extends AbstractJob {
|
||||
releaseSnapshots();
|
||||
|
||||
snapshotInfos.clear();
|
||||
fileMapping.clear();
|
||||
jobInfo.releaseSnapshotInfo();
|
||||
|
||||
finishedTime = System.currentTimeMillis();
|
||||
state = RestoreJobState.FINISHED;
|
||||
@ -1993,6 +1995,9 @@ public class RestoreJob extends AbstractJob {
|
||||
releaseSnapshots();
|
||||
|
||||
snapshotInfos.clear();
|
||||
fileMapping.clear();
|
||||
jobInfo.releaseSnapshotInfo();
|
||||
|
||||
RestoreJobState curState = state;
|
||||
finishedTime = System.currentTimeMillis();
|
||||
state = RestoreJobState.CANCELLED;
|
||||
|
||||
Reference in New Issue
Block a user