xtern commented on code in PR #3203:
URL: https://github.com/apache/ignite-3/pull/3203#discussion_r1487505246
##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/util/cache/CaffeineCacheFactory.java:
##########
@@ -20,19 +20,35 @@
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.RemovalCause;
import com.github.benmanes.caffeine.cache.stats.CacheStats;
+import java.util.concurrent.Executor;
import java.util.function.BiFunction;
import java.util.function.Function;
import java.util.function.Predicate;
import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.TestOnly;
/**
* Factory that creates caches backed by {@link Caffeine} cache.
*/
public class CaffeineCacheFactory implements CacheFactory {
public static final CacheFactory INSTANCE = new CaffeineCacheFactory();
+ @Nullable
+ private final Executor executor;
+
private CaffeineCacheFactory() {
+ this.executor = null;
+ }
+
+ private CaffeineCacheFactory(@Nullable Executor executor) {
+ this.executor = executor;
+ }
+
+ /** Creates a cache factory with the given executor for running auxiliary
tasks. */
+ @TestOnly
+ public static CacheFactory create(@Nullable Executor executor) {
Review Comment:
```suggestion
public static CacheFactory create(Executor executor) {
```
As I understand, this method only exists for passing the executor, so it's
unclear why anyone would use it with a `null` argument.
--
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]