AMashenkov commented on code in PR #3146:
URL: https://github.com/apache/ignite-3/pull/3146#discussion_r1479878625
##########
modules/api/src/main/java/org/apache/ignite/table/mapper/OneColumnMapperImpl.java:
##########
@@ -26,6 +28,10 @@
* @param <ObjectT> Target type.
*/
class OneColumnMapperImpl<ObjectT> implements OneColumnMapper<ObjectT> {
+
+ /** Cache of one column mappers. */
+ private static final ConcurrentHashMap<CacheKey, OneColumnMapper<?>> CACHE
= new ConcurrentHashMap<>();
Review Comment:
This cache allow us to reuse `OneColumnMapperImpl`objects.
So, instead of creating `OneColumnMapperImpl` - object of 3 fields, we
create a `CacheKey` object of 2 fields and do synchronized lookup into a map
(compute call).
What are we trying to fix here? Object constructor is trivial.
--
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]