Replace fastjson with jackson for nacos-cmdb

This commit is contained in:
KomachiSion 2020-05-26 16:04:52 +08:00
parent bbeb7d6a4a
commit 2aaa54a19b

View File

@ -15,7 +15,6 @@
*/ */
package com.alibaba.nacos.cmdb.memory; package com.alibaba.nacos.cmdb.memory;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.api.cmdb.spi.CmdbService; import com.alibaba.nacos.api.cmdb.spi.CmdbService;
import com.alibaba.nacos.api.cmdb.pojo.Entity; import com.alibaba.nacos.api.cmdb.pojo.Entity;
import com.alibaba.nacos.api.cmdb.pojo.EntityEvent; import com.alibaba.nacos.api.cmdb.pojo.EntityEvent;
@ -26,6 +25,8 @@ import com.alibaba.nacos.cmdb.service.CmdbReader;
import com.alibaba.nacos.cmdb.service.CmdbWriter; import com.alibaba.nacos.cmdb.service.CmdbWriter;
import com.alibaba.nacos.cmdb.utils.Loggers; import com.alibaba.nacos.cmdb.utils.Loggers;
import com.alibaba.nacos.cmdb.utils.UtilsAndCommons; import com.alibaba.nacos.cmdb.utils.UtilsAndCommons;
import com.alibaba.nacos.common.utils.JacksonUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -166,7 +167,7 @@ public class CmdbProvider implements CmdbReader, CmdbWriter {
} }
if (Loggers.MAIN.isDebugEnabled()) { if (Loggers.MAIN.isDebugEnabled()) {
Loggers.MAIN.debug("LABEL-TASK {}", "got label map:" + JSON.toJSONString(tmpLabelMap)); Loggers.MAIN.debug("LABEL-TASK {}", "got label map:" + JacksonUtils.toJson(tmpLabelMap));
} }
labelMap = tmpLabelMap; labelMap = tmpLabelMap;
@ -219,7 +220,7 @@ public class CmdbProvider implements CmdbReader, CmdbWriter {
eventTimestamp = current; eventTimestamp = current;
if (Loggers.MAIN.isDebugEnabled()) { if (Loggers.MAIN.isDebugEnabled()) {
Loggers.MAIN.debug("EVENT-TASK {}", "got events size:" + ", events:" + JSON.toJSONString(events)); Loggers.MAIN.debug("EVENT-TASK {}", "got events size:" + ", events:" + JacksonUtils.toJson(events));
} }
if (events != null && !events.isEmpty()) { if (events != null && !events.isEmpty()) {