From b82840a9d1da20fdec7f2acaf4e5ee4213a7e9e7 Mon Sep 17 00:00:00 2001 From: M Sazzadul Hoque <7600764+sazzad16@users.noreply.github.com> Date: Tue, 13 Feb 2024 00:48:21 +0600 Subject: [PATCH] common default values in base class --- src/main/java/redis/clients/jedis/ClientSideCache.java | 3 +++ src/main/java/redis/clients/jedis/util/CaffeineCSC.java | 2 -- src/main/java/redis/clients/jedis/util/GuavaCSC.java | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/redis/clients/jedis/ClientSideCache.java b/src/main/java/redis/clients/jedis/ClientSideCache.java index 01e5fb669c..c2c9248acf 100644 --- a/src/main/java/redis/clients/jedis/ClientSideCache.java +++ b/src/main/java/redis/clients/jedis/ClientSideCache.java @@ -16,6 +16,9 @@ */ public abstract class ClientSideCache { + protected static final int DEFAULT_MAXIMUM_SIZE = 10_000; + protected static final int DEFAULT_EXPIRE_SECONDS = 100; + private final Map> keyToCommandHashes; protected ClientSideCache() { diff --git a/src/main/java/redis/clients/jedis/util/CaffeineCSC.java b/src/main/java/redis/clients/jedis/util/CaffeineCSC.java index e8de08a654..3bce3504b3 100644 --- a/src/main/java/redis/clients/jedis/util/CaffeineCSC.java +++ b/src/main/java/redis/clients/jedis/util/CaffeineCSC.java @@ -10,8 +10,6 @@ public class CaffeineCSC extends ClientSideCache { - private static final int DEFAULT_MAXIMUM_SIZE = 10_000; - private static final int DEFAULT_EXPIRE_SECONDS = 100; private static final LongHashFunction DEFAULT_HASH_FUNCTION = LongHashFunction.xx3(); private final Cache cache; diff --git a/src/main/java/redis/clients/jedis/util/GuavaCSC.java b/src/main/java/redis/clients/jedis/util/GuavaCSC.java index 8376964d22..d9973b7dc6 100644 --- a/src/main/java/redis/clients/jedis/util/GuavaCSC.java +++ b/src/main/java/redis/clients/jedis/util/GuavaCSC.java @@ -10,8 +10,6 @@ public class GuavaCSC extends ClientSideCache { - private static final int DEFAULT_MAXIMUM_SIZE = 10_000; - private static final int DEFAULT_EXPIRE_SECONDS = 100; private static final HashFunction DEFAULT_HASH_FUNCTION = com.google.common.hash.Hashing.fingerprint2011(); private final Cache cache;