You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "kfaraz (via GitHub)" <gi...@apache.org> on 2025/01/06 09:09:50 UTC

[PR] Do not use deprecated API ObjectMapper.writerWithType() (druid)

kfaraz opened a new pull request, #17606:
URL: https://github.com/apache/druid/pull/17606

   ### Changes
   
   - Replace usages of `ObjectMapper.writeWithType()` with the recommended `ObjectMapper.writerFor()`
   - There is no difference between the two implementations but the older method is deprecated
   since jackson version 2.5 and may be removed in the future


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Do not use deprecated Jackson API ObjectMapper.writerWithType() (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on PR #17606:
URL: https://github.com/apache/druid/pull/17606#issuecomment-2687209597

   Thanks for the review, @kgyrtkirk !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Do not use deprecated Jackson API ObjectMapper.writerWithType() (druid)

Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on code in PR #17606:
URL: https://github.com/apache/druid/pull/17606#discussion_r1906234512


##########
indexing-hadoop/src/main/java/org/apache/druid/indexer/DetermineHashedPartitionsJob.java:
##########
@@ -412,7 +412,7 @@ protected void reduce(
 
       try {
         HadoopDruidIndexerConfig.JSON_MAPPER
-            .writerWithType(Long.class)
+            .writerFor(Long.class)

Review Comment:
   Lets put this in the forbidden api's ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Do not use deprecated Jackson API ObjectMapper.writerWithType() (druid)

Posted by "kfaraz (via GitHub)" <gi...@apache.org>.
kfaraz commented on code in PR #17606:
URL: https://github.com/apache/druid/pull/17606#discussion_r1906847807


##########
indexing-hadoop/src/main/java/org/apache/druid/indexer/DetermineHashedPartitionsJob.java:
##########
@@ -412,7 +412,7 @@ protected void reduce(
 
       try {
         HadoopDruidIndexerConfig.JSON_MAPPER
-            .writerWithType(Long.class)
+            .writerFor(Long.class)

Review Comment:
   Good point. I have added the check which would give the following error when the deprecated method is used:
   
   ```
   [ERROR] Forbidden method invocation: com.fasterxml.jackson.databind.ObjectMapper#writerWithType(com.fasterxml.jackson.core.type.TypeReference) [Use ObjectMapper#writeFor instead]
   [ERROR]   in org.apache.druid.server.coordinator.loading.HttpLoadQueuePeon (HttpLoadQueuePeon.java:135)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Do not use deprecated Jackson API ObjectMapper.writerWithType() (druid)

Posted by "kgyrtkirk (via GitHub)" <gi...@apache.org>.
kgyrtkirk closed pull request #17606: Do not use deprecated Jackson API ObjectMapper.writerWithType()
URL: https://github.com/apache/druid/pull/17606


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Do not use deprecated Jackson API ObjectMapper.writerWithType() (druid)

Posted by "kgyrtkirk (via GitHub)" <gi...@apache.org>.
kgyrtkirk commented on PR #17606:
URL: https://github.com/apache/druid/pull/17606#issuecomment-2684487035

   Thank you @kfaraz for the cleanup!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Do not use deprecated Jackson API ObjectMapper.writerWithType() (druid)

Posted by "kgyrtkirk (via GitHub)" <gi...@apache.org>.
kgyrtkirk merged PR #17606:
URL: https://github.com/apache/druid/pull/17606


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org