Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Jun 19, 2024
1 parent 852fbfd commit 6635c8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.doris.analysis.PartitionNames;
import org.apache.doris.analysis.TableRef;
import org.apache.doris.backup.RestoreFileMapping.IdChain;
import org.apache.doris.catalog.Env;
import org.apache.doris.catalog.MaterializedIndex;
import org.apache.doris.catalog.MaterializedIndex.IndexExtState;
import org.apache.doris.catalog.OdbcCatalogResource;
Expand All @@ -34,6 +35,7 @@
import org.apache.doris.catalog.View;
import org.apache.doris.common.Config;
import org.apache.doris.common.FeConstants;
import org.apache.doris.common.FeMetaVersion;
import org.apache.doris.common.Version;
import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
Expand Down Expand Up @@ -133,6 +135,7 @@ public static class NetworkAddrss {

// This map is used to save the table alias mapping info when processing a restore job.
// origin -> alias
@SerializedName("tblalias")
public Map<String, String> tblAlias = Maps.newHashMap();

public long getBackupTime() {
Expand Down Expand Up @@ -807,17 +810,16 @@ public void releaseSnapshotInfo() {
}

public static BackupJobInfo read(DataInput in) throws IOException {
return BackupJobInfo.readFields(in);
if (Env.getCurrentEnvJournalVersion() < FeMetaVersion.VERSION_135) {
return BackupJobInfo.readFields(in);
}
String json = Text.readString(in);
return genFromJson(json);
}

@Override
public void write(DataOutput out) throws IOException {
Text.writeString(out, toJson(false));
out.writeInt(tblAlias.size());
for (Map.Entry<String, String> entry : tblAlias.entrySet()) {
Text.writeString(out, entry.getKey());
Text.writeString(out, entry.getValue());
}
}

public static BackupJobInfo readFields(DataInput in) throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

package org.apache.doris.backup;

import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
import org.apache.doris.persist.gson.GsonUtils;

import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
Expand Down Expand Up @@ -102,10 +104,7 @@ public int hashCode() {

@Override
public void write(DataOutput out) throws IOException {
out.writeInt(chain.length);
for (Long id : chain) {
out.writeLong(id);
}
Text.writeString(out, GsonUtils.GSON.toJson(this));
}

public void readFields(DataInput in) throws IOException {
Expand All @@ -124,8 +123,10 @@ public static IdChain read(DataInput in) throws IOException {
}

// catalog ids -> repository ids
@SerializedName("m")
private Map<IdChain, IdChain> mapping = Maps.newHashMap();
// tablet id -> is overwrite
@SerializedName("o")
private Map<Long, Boolean> overwriteMap = Maps.newHashMap();

public RestoreFileMapping() {
Expand Down

0 comments on commit 6635c8b

Please sign in to comment.