Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dataroaring committed Jun 22, 2024
1 parent 5685f7d commit 6a70776
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

Expand Down Expand Up @@ -602,7 +603,7 @@ public static Database read(DataInput in) throws IOException {

@Override
public void gsonPostProcess() throws IOException {
Preconditions.checkState(nameToTable.getClass() == ConcurrentMap.class,
Preconditions.checkState(nameToTable.getClass() == ConcurrentHashMap.class,
"nameToTable should be ConcurrentMap");
fullQualifiedName = ClusterNamespace.getNameFromFullName(fullQualifiedName);
nameToTable.forEach((tn, tb) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ConcurrentHashMap;

/**
* user define encryptKey in current db.
Expand Down Expand Up @@ -60,7 +61,7 @@ public static DatabaseEncryptKey read(DataInput in) throws IOException {

@Override
public void gsonPostProcess() throws IOException {
Preconditions.checkState(name2EncryptKey.getClass() == ConcurrentMap.class,
Preconditions.checkState(name2EncryptKey.getClass() == ConcurrentHashMap.class,
"name2EncryptKey should be ConcurrentMap, but is " + name2EncryptKey.getClass());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
import org.apache.doris.common.util.URI;
import org.apache.doris.persist.gson.GsonUtils;
import org.apache.doris.qe.SessionVariable;
import org.apache.doris.thrift.TFunction;
import org.apache.doris.thrift.TFunctionBinaryType;
Expand Down Expand Up @@ -671,7 +672,7 @@ public static FunctionType read(DataInput input) throws IOException {

@Override
public void write(DataOutput output) throws IOException {
throw new Error("Origin function cannot be serialized");
Text.writeString(output, GsonUtils.GSON.toJson(this));
}

protected void readFields(DataInput input) throws IOException {
Expand Down

0 comments on commit 6a70776

Please sign in to comment.