You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "yifan-c (via GitHub)" <gi...@apache.org> on 2024/09/17 19:03:35 UTC

Re: [PR] CASSANDRA-19927: Remove old compression cache and move to using cache of Compressio… [cassandra-analytics]

yifan-c commented on code in PR #84:
URL: https://github.com/apache/cassandra-analytics/pull/84#discussion_r1763750927


##########
cassandra-four-zero-bridge/src/main/java/org/apache/cassandra/spark/reader/SSTableCache.java:
##########
@@ -20,10 +20,13 @@
 package org.apache.cassandra.spark.reader;
 
 import java.io.IOException;
+import java.io.InputStream;
 import java.util.Map;
+import java.util.Optional;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
+import java.util.function.Function;
 
 import com.google.common.cache.Cache;

Review Comment:
   As a potential follow-up, can we migrate to Caffeine for caching?



##########
cassandra-four-zero-bridge/src/main/java/org/apache/cassandra/spark/reader/SSTableCache.java:
##########
@@ -59,15 +64,32 @@ public class SSTableCache
                                                                                           propOrDefault("sbr.cache.stats.expireAfterMins", 60));
     private final Cache<SSTable, BloomFilter>                         filter = buildCache(propOrDefault("sbr.cache.filter.maxEntries", 16384),
                                                                                           propOrDefault("sbr.cache.filter.expireAfterMins", 60));
+    private final Cache<SSTable, Optional<CompressionMetadata>>       compressionMetadata = buildCache(propOrDefault("sbr.cache.compressionInfo.maxEntries", 128),

Review Comment:
   Can you comment why the cache value is `Optional`?



-- 
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@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org