Skip to content

Commit 398e55a

Browse files
authored
fix debug log jackson range part error (#366)
1 parent bebf2b5 commit 398e55a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/com/alipay/oceanbase/rpc/location/model/TableLocations.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObFetchPartitionMetaResult;
2828
import com.alipay.oceanbase.rpc.protocol.payload.impl.execute.ObFetchPartitionMetaType;
2929
import com.alipay.oceanbase.rpc.table.ObTable;
30+
import com.fasterxml.jackson.databind.SerializationFeature;
3031
import org.slf4j.Logger;
3132

3233
import java.util.Map;
@@ -43,6 +44,12 @@
4344
public class TableLocations {
4445
private static final Logger logger = getLogger(TableLocations.class);
4546
private static final ObjectMapper objectMapper = new ObjectMapper();
47+
static {
48+
// FAIL_ON_EMPTY_BEANS means that whether throwing exception if there is no any serializable member with getter or setter in an object
49+
// considering partitionElements in range partDesc is a list of Comparable interface and Comparable has no getter and setter
50+
// we have to set this configuration as false because tableEntry may be serialized in debug log
51+
objectMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
52+
}
4653
private final ObTableClient tableClient;
4754
private Map<String, Lock> metaRefreshingLocks = new ConcurrentHashMap<String, Lock>();
4855
private Map<String, Lock> locationBatchRefreshingLocks = new ConcurrentHashMap<String, Lock>();

0 commit comments

Comments
 (0)