You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@celeborn.apache.org by et...@apache.org on 2024/06/20 11:25:56 UTC

(celeborn) branch main updated: [CELEBORN-1471] CelebornScalaObjectMapper supports configuring FAIL_ON_UNKNOWN_PROPERTIES to false

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

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


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

commit 985542679054709391c9eca8983e7011400bcfa7
Author: SteNicholas <pr...@163.com>
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 <pr...@163.com>
    Signed-off-by: mingji <fe...@alibaba-inc.com>
---
 .../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
 }