Skip to content
Merged
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 @@ -27,6 +27,7 @@
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObFetchPartitionMetaResult;
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObFetchPartitionMetaType;
import com.alipay.oceanbase.rpc.table.ObTable;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.slf4j.Logger;

import java.util.Map;
Expand All @@ -43,6 +44,12 @@
public class TableLocations {
private static final Logger logger = getLogger(TableLocations.class);
private static final ObjectMapper objectMapper = new ObjectMapper();
static {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加注释说明,还有为什么不能识别,一般都开这个开关吗,是不是应该是解决不能识别的问题,还是都是这样通过打开开关解决这类问题的

@JackShi148 JackShi148 Jul 25, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个配置的意思是“一个类找不到可序列化的成员是否报错”,jackson 是默认为true。我们之所以要设置成 false 是因为在 range 分区中,分区键类型比较多,使用的是 List<Comparable>,而 Comparable 是一个接口,没有 jackson 需要的 getter setter 函数,所以如果不将此设置为 false,Jackson 在debug 级别日志中序列化 range 分区的分区键时就会报错。

// FAIL_ON_EMPTY_BEANS means that whether throwing exception if there is no any serializable member with getter or setter in an object
// considering partitionElements in range partDesc is a list of Comparable interface and Comparable has no getter and setter
// we have to set this configuration as false because tableEntry may be serialized in debug log
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
}
private final ObTableClient tableClient;
private Map<String, Lock> metaRefreshingLocks = new ConcurrentHashMap<String, Lock>();
private Map<String, Lock> locationBatchRefreshingLocks = new ConcurrentHashMap<String, Lock>();
Expand Down