deniskuzZ commented on code in PR #5541:
URL: https://github.com/apache/hive/pull/5541#discussion_r1907479189


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergMetaHook.java:
##########
@@ -137,6 +146,7 @@
 
 public class HiveIcebergMetaHook implements HiveMetaHook {
   private static final Logger LOG = 
LoggerFactory.getLogger(HiveIcebergMetaHook.class);
+  private final ObjectMapper jsonObjectMapper = new ObjectMapper();

Review Comment:
   see 
https://stackoverflow.com/questions/3907929/should-i-declare-jacksons-objectmapper-as-a-static-field
   ````
   keep static ObjectMapper somewhere, but only get ObjectReader / ObjectWriter 
instances (via helper methods), retain references to those in other places (or 
dynamically call). These reader/writer objects are not only fully thread-safe 
wrt reconfiguration, but also very light-weight (wrt mapper instances). So 
keeping thousands of references does not add much memory usage
   ````



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to