Details
-
Task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
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.
Attachments
Issue Links
- relates to
-
DRILL-8430 Add factory method for creating Jackson ObjectMappers
-
- Closed
-