This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new bb16f66e22 HDDS-12448. Avoid using Jackson1 (#7994)
bb16f66e22 is described below
commit bb16f66e22c44b360d42d0cae87024786e27c61b
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Mon Mar 3 13:43:06 2025 +0100
HDDS-12448. Avoid using Jackson1 (#7994)
---
.../org/apache/hadoop/ozone/om/service/QuotaRepairTask.java | 4 ++--
pom.xml | 11 +++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)
diff --git
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java
index 7d03780d62..35ffca1009 100644
---
a/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java
+++
b/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/service/QuotaRepairTask.java
@@ -44,6 +44,7 @@
import java.util.concurrent.atomic.AtomicLong;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.server.JsonUtils;
import org.apache.hadoop.hdds.utils.db.DBCheckpoint;
import org.apache.hadoop.hdds.utils.db.Table;
import org.apache.hadoop.hdds.utils.db.TableIterator;
@@ -57,7 +58,6 @@
import org.apache.hadoop.ozone.om.ratis.utils.OzoneManagerRatisUtils;
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
import org.apache.ratis.protocol.ClientId;
-import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -487,7 +487,7 @@ public String toString() {
status.put("errorMsg", errorMsg);
status.put("bucketCountDiffMap", bucketCountDiffMap);
try {
- return new ObjectMapper().writeValueAsString(status);
+ return JsonUtils.toJsonString(status);
} catch (IOException e) {
LOG.error("error in generating status", e);
return "{}";
diff --git a/pom.xml b/pom.xml
index a3e8d47b04..e91207b028 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1683,6 +1683,17 @@
<excludedSourceRoot>${project.build.directory}/generated-sources/protobuf/java</excludedSourceRoot>
</excludedSourceRoots>
</restrictImports>
+ <restrictImports>
+ <includeTestCode>true</includeTestCode>
+ <reason>Use Jackson 2 (com.fasterxml.jackson)</reason>
+ <bannedImports>
+ <bannedImport>org.codehaus.jackson.**</bannedImport>
+ </bannedImports>
+ <excludedSourceRoots>
+
<excludedSourceRoot>${project.build.directory}/generated-sources/java</excludedSourceRoot>
+
<excludedSourceRoot>${project.build.directory}/generated-sources/protobuf/java</excludedSourceRoot>
+ </excludedSourceRoots>
+ </restrictImports>
</rules>
</configuration>
</execution>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]