Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ private void prepareAndSendSnapshotTask() {
}
}

backupMeta = new BackupMeta(db.getName(), copiedTables, copiedResources);
backupMeta = new BackupMeta(copiedTables, copiedResources);

// send tasks
for (AgentTask task : batchTask.getAllTasks()) {
Expand Down
11 changes: 1 addition & 10 deletions fe/fe-core/src/main/java/org/apache/doris/backup/BackupMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
import java.util.Map;

public class BackupMeta implements Writable, GsonPostProcessable {
@SerializedName(value = "db")
private String dbName;

// tbl name -> tbl
@SerializedName(value = "tblNameMap")
private Map<String, Table> tblNameMap = Maps.newHashMap();
Expand All @@ -59,9 +56,7 @@ public class BackupMeta implements Writable, GsonPostProcessable {
private BackupMeta() {
}

public BackupMeta(String dbName, List<Table> tables, List<Resource> resources) {
this.dbName = dbName;

public BackupMeta(List<Table> tables, List<Resource> resources) {
for (Table table : tables) {
tblNameMap.put(table.getName(), table);
tblIdMap.put(table.getId(), table);
Expand All @@ -71,10 +66,6 @@ public BackupMeta(String dbName, List<Table> tables, List<Resource> resources) {
}
}

public String getDbName() {
return dbName;
}

public Map<String, Table> getTables() {
return tblNameMap;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ private void checkAndPrepareMeta() {
}

// reset all ids in this table
String srcDbName = backupMeta.getDbName();
String srcDbName = jobInfo.dbName;
Status st = remoteOlapTbl.resetIdsForRestore(env, db, replicaAlloc, reserveReplica, srcDbName);
if (!st.ok()) {
status = st;
Expand Down Expand Up @@ -801,7 +801,7 @@ private void checkAndPrepareMeta() {
return;
}
} else {
String srcDbName = backupMeta.getDbName();
String srcDbName = jobInfo.dbName;
remoteView.resetIdsForRestore(env, srcDbName, db.getFullName());
restoredTbls.add(remoteView);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public Status getSnapshotInfoFile(String label, String backupTimestamp, List<Bac
List<Table> tbls = Lists.newArrayList();
tbls.add(tbl);
List<Resource> resources = Lists.newArrayList();
BackupMeta backupMeta = new BackupMeta(null, tbls, resources);
BackupMeta backupMeta = new BackupMeta(tbls, resources);
Map<Long, SnapshotInfo> snapshotInfos = Maps.newHashMap();
for (Partition part : tbl.getPartitions()) {
for (MaterializedIndex idx : part.getMaterializedIndices(IndexExtState.VISIBLE)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ boolean await(long timeout, TimeUnit unit) {
List<Table> tbls = Lists.newArrayList();
List<Resource> resources = Lists.newArrayList();
tbls.add(expectedRestoreTbl);
backupMeta = new BackupMeta(null, tbls, resources);
backupMeta = new BackupMeta(tbls, resources);
}

@Test
Expand Down