PJ Fanning created DRILL-8431:
---------------------------------

             Summary: add immutable wrapper for ObjectMapper
                 Key: DRILL-8431
                 URL: https://issues.apache.org/jira/browse/DRILL-8431
             Project: Apache Drill
          Issue Type: Task
          Components:  Server
            Reporter: PJ Fanning


The Jackson based code in Drill is quite complicated and passes around 
ObjectMapper instances in a way that is difficult to maintain.

We need to balance the objective of trying to reuse ObjectMapper instances 
(because they are fairly expensive to create) but avoid the risk that code 
modifies an ObjectMapper instance (extra config or extra modules added) in a 
way that affects other code that uses the ObjectMapper instance.

Jackson 3 (which is under development but a long way off) moves towards making 
ObjectMappers immutable. Mapper Builders are used instead to configure mappers. 
Some of these API changes are already backported to Jackson 2.

My suggestion in this Jira is that we create a new Drill class called 
ImmutableObjectMapper and this exposes API methods for reading and writing JSON 
but that hides methods for configuring the mapper. We can wrap some of our 
ObjectMappers. It will probably take a few iterations to get everything 
switched over but we can start with the low hanging fruit.

This class would allow the Java compiler to check for any untidy attempts to 
modify an ObjectMapper that was created elsewhere. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to