tkhurana commented on code in PR #2247: URL: https://github.com/apache/phoenix/pull/2247#discussion_r2240805542
########## phoenix-core-server/src/main/java/org/apache/phoenix/coprocessor/CDCCompactionUtil.java: ########## @@ -53,19 +54,206 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.apache.phoenix.thirdparty.com.google.common.cache.Cache; +import org.apache.phoenix.thirdparty.com.google.common.cache.CacheBuilder; + /** * Utility class for CDC (Change Data Capture) operations during compaction. This class contains * utilities for handling TTL row expiration events and generating CDC events with pre-image data - * that are written directly to CDC index tables. + * that are written directly to CDC index tables using batch mutations. */ public final class CDCCompactionUtil { private static final Logger LOGGER = LoggerFactory.getLogger(CDCCompactionUtil.class); + // Shared cache for row images across all CompactionScanner instances in the JVM. + // Entries expire after 1200 seconds (20 minutes) by default. + // The JVM level cache helps merge the pre-image for the row with multiple CFs. + // The key of the cache contains (regionId + data table rowkey). Review Comment: Is there any advantage to have a global cache with the region id as the key ? Couldn't this be a per region object just like CompactionScanner ? -- 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: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org