This is an automated email from the ASF dual-hosted git repository.

ethanfeng pushed a commit to branch branch-0.5
in repository https://gitbox.apache.org/repos/asf/celeborn.git


The following commit(s) were added to refs/heads/branch-0.5 by this push:
     new 83da73a2b [CELEBORN-1471] CelebornScalaObjectMapper supports 
configuring FAIL_ON_UNKNOWN_PROPERTIES to false
83da73a2b is described below

commit 83da73a2bdd598b48eec1c30e4f1d769424f3cb4
Author: SteNicholas <[email protected]>
AuthorDate: Thu Jun 20 19:25:21 2024 +0800

    [CELEBORN-1471] CelebornScalaObjectMapper supports configuring 
FAIL_ON_UNKNOWN_PROPERTIES to false
    
    ### What changes were proposed in this pull request?
    
    `CelebornScalaObjectMapper` supports configuring 
`FAIL_ON_UNKNOWN_PROPERTIES` to false.
    
    ### Why are the changes needed?
    
    `CelebornScalaObjectMapper` would fail on unknown properties in Celeborn 
server side. Therefore, `CelebornScalaObjectMapper` could support configuring 
`FAIL_ON_UNKNOWN_PROPERTIES` to false which does not fail on unknown properties 
for Celeborn Master/Worker.
    
    Backport: https://github.com/apache/kyuubi/pull/4691.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    No.
    
    Closes #2582 from SteNicholas/CELEBORN-1471.
    
    Authored-by: SteNicholas <[email protected]>
    Signed-off-by: mingji <[email protected]>
    (cherry picked from commit 985542679054709391c9eca8983e7011400bcfa7)
    Signed-off-by: mingji <[email protected]>
---
 .../celeborn/server/common/http/api/CelebornScalaObjectMapper.scala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/service/src/main/scala/org/apache/celeborn/server/common/http/api/CelebornScalaObjectMapper.scala
 
b/service/src/main/scala/org/apache/celeborn/server/common/http/api/CelebornScalaObjectMapper.scala
index 37375e2c1..7315e5c56 100644
--- 
a/service/src/main/scala/org/apache/celeborn/server/common/http/api/CelebornScalaObjectMapper.scala
+++ 
b/service/src/main/scala/org/apache/celeborn/server/common/http/api/CelebornScalaObjectMapper.scala
@@ -19,11 +19,13 @@ package org.apache.celeborn.server.common.http.api
 
 import javax.ws.rs.ext.ContextResolver
 
-import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.databind.{DeserializationFeature, ObjectMapper}
 import com.fasterxml.jackson.module.scala.DefaultScalaModule
 
 class CelebornScalaObjectMapper extends ContextResolver[ObjectMapper] {
-  private val mapper = new ObjectMapper().registerModule(DefaultScalaModule)
+  private val mapper = new ObjectMapper()
+    .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
+    .registerModule(DefaultScalaModule)
 
   override def getContext(aClass: Class[_]): ObjectMapper = mapper
 }

Reply via email to