Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Jun 20, 2024
1 parent f56fa78 commit 84849cb
Showing 1 changed file with 7 additions and 37 deletions.
44 changes: 7 additions & 37 deletions fe/fe-core/src/main/java/org/apache/doris/backup/RestoreJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.datasource.property.S3ClientBEProperties;
import org.apache.doris.persist.gson.GsonPostProcessable;
// import org.apache.doris.persist.gson.GsonUtils;
import org.apache.doris.persist.gson.GsonUtils;
import org.apache.doris.resource.Tag;
import org.apache.doris.task.AgentBatchTask;
import org.apache.doris.task.AgentTask;
Expand Down Expand Up @@ -100,7 +100,6 @@
import org.apache.logging.log4j.Logger;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -2097,45 +2096,16 @@ private void setTableStateToNormal(Database db, boolean committed, boolean isRep
}
}

public void write(DataOutput out) throws IOException {
// ATTN: must write type first
Text.writeString(out, type.name());

out.writeLong(repoId);
Text.writeString(out, label);
out.writeLong(jobId);
out.writeLong(dbId);
Text.writeString(out, dbName);

out.writeLong(createTime);
out.writeLong(finishedTime);
out.writeLong(timeoutMs);

if (!taskErrMsg.isEmpty()) {
out.writeBoolean(true);
// we only save at most 3 err msgs
int savedNum = Math.min(3, taskErrMsg.size());
out.writeInt(savedNum);
for (Map.Entry<Long, String> entry : taskErrMsg.entrySet()) {
if (savedNum == 0) {
break;
}
out.writeLong(entry.getKey());
Text.writeString(out, entry.getValue());
savedNum--;
}
Preconditions.checkState(savedNum == 0, savedNum);
public static RestoreJob read(DataInput in) throws IOException {
if (Env.getCurrentEnvJournalVersion() < FeMetaVersion.VERSION_136) {
RestoreJob job = new RestoreJob();
job.readFields(in);
return job;
} else {
out.writeBoolean(false);
return GsonUtils.GSON.fromJson(Text.readString(in), RestoreJob.class);
}
}

public static RestoreJob read(DataInput in) throws IOException {
RestoreJob job = new RestoreJob();
job.readFields(in);
return job;
}

@Deprecated
@Override
public void readFields(DataInput in) throws IOException {
Expand Down

0 comments on commit 84849cb

Please sign in to comment.