szehon-ho commented on code in PR #6857:
URL: https://github.com/apache/iceberg/pull/6857#discussion_r1109206073


##########
aws/src/main/java/org/apache/iceberg/aws/s3/signer/S3ObjectMapper.java:
##########
@@ -44,24 +45,23 @@ public class S3ObjectMapper {
 
   private static final JsonFactory FACTORY = new JsonFactory();
   private static final ObjectMapper MAPPER = new ObjectMapper(FACTORY);
-  private static volatile boolean isInitialized = false;
+  private static final AtomicReference<ObjectMapper> REFERENCE = new 
AtomicReference<>();
 
   private S3ObjectMapper() {}
 
   static ObjectMapper mapper() {
-    if (!isInitialized) {
-      synchronized (S3ObjectMapper.class) {
-        if (!isInitialized) {
-          MAPPER.setVisibility(PropertyAccessor.FIELD, 
JsonAutoDetect.Visibility.ANY);
-          MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, 
false);
-          
MAPPER.setPropertyNamingStrategy(PropertyNamingStrategies.KebabCaseStrategy.INSTANCE);
-          MAPPER.registerModule(initModule());
-          isInitialized = true;
-        }
-      }
+    if (null == REFERENCE.get()) {
+      MAPPER.setVisibility(PropertyAccessor.FIELD, 
JsonAutoDetect.Visibility.ANY);

Review Comment:
   Trying to understand this change, arent multiple threads now going to 
conflict now when setting the MAPPER variable ?  There is still a single 
reference to MAPPER, isn't there?



-- 
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