You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/02/14 08:55:57 UTC

[GitHub] [hudi] danny0405 commented on a change in pull request #4806: [HUDI-3419] Load class through reflection in a thread-safe way.

danny0405 commented on a change in pull request #4806:
URL: https://github.com/apache/hudi/pull/4806#discussion_r805621560



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/util/ReflectionUtils.java
##########
@@ -45,7 +45,7 @@
 
   private static final Logger LOG = LogManager.getLogger(ReflectionUtils.class);
 
-  private static final Map<String, Class<?>> CLAZZ_CACHE = new HashMap<>();
+  private static final Map<String, Class<?>> CLAZZ_CACHE = new ConcurrentHashMap<>();

Review comment:
       Thanks, can you explain why it is not thread-safe now, we already add a synchronized lock on the cache `CLAZZ_CACHE`.




-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org