[
https://issues.apache.org/jira/browse/KYLIN-5291?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17634271#comment-17634271
]
ASF GitHub Bot commented on KYLIN-5291:
---------------------------------------
Mukvin commented on code in PR #2015:
URL: https://github.com/apache/kylin/pull/2015#discussion_r1022574630
##########
cache/src/main/java/org/apache/kylin/cache/cachemanager/RedisManager.java:
##########
@@ -0,0 +1,191 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.kylin.cache.cachemanager;
+
+import org.apache.commons.lang3.SerializationUtils;
+import org.apache.kylin.cache.redis.RedisClient;
+import org.apache.kylin.cache.redis.RedisConfig;
+import org.apache.kylin.cache.redis.jedis.JedisPoolClient;
+import org.apache.kylin.shaded.com.google.common.annotations.VisibleForTesting;
+import org.apache.kylin.shaded.com.google.common.collect.Lists;
+import
org.apache.kylin.shaded.com.google.common.util.concurrent.ThreadFactoryBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cache.Cache;
+import org.springframework.cache.support.SimpleValueWrapper;
+import java.util.Collection;
+import java.util.concurrent.Callable;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import static org.apache.kylin.cache.redis.RedisClientTypeEnum.JEDIS_POOL;
+
+
+public class RedisManager extends AbstractRemoteCacheManager {
+
+ private static final Logger logger =
LoggerFactory.getLogger(RedisManager.class);
+ private static final Long ONE_MINUTE = 60 * 1000L;
+
+ @Autowired
+ private RedisConfig redisConfig;
+
+ private ScheduledExecutorService timer =
Executors.newScheduledThreadPool(1,
+ new
ThreadFactoryBuilder().setNameFormat("Redis-HealthChecker").build());
+ private AtomicBoolean clusterHealth = new AtomicBoolean(true);
+
+ @Override
+ protected Collection<? extends Cache> loadCaches() {
+ Cache successCache = new
RedisManager.RedisCacheAdaptor(createRedisClient(redisConfig),
CacheConstants.QUERY_CACHE);
+
+ addCache(successCache);
Review Comment:
addCache is a deprecated method
> introducing redis as a distributed cache for kylin
> --------------------------------------------------
>
> Key: KYLIN-5291
> URL: https://issues.apache.org/jira/browse/KYLIN-5291
> Project: Kylin
> Issue Type: New Feature
> Reporter: wuxinqiang
> Priority: Major
> Attachments: KYLIN-5291.main.001.patch, screenshot-1.png,
> screenshot-2.png
>
>
> The distributed cache of kylin4.x only introduces memcache, but currently
> redis is more widely used. If you want to use the distributed cache directly,
> you need to deploy a full set of memcache, and the investment cost is high.
> Memcache has better performance in querying large objects than redis, but
> according to the size distribution of query data currently in Youzan, 99.97%
> of the data is smaller than 1MB, and the scenario is also suitable for
> accessing redis.
> Whether it can introduce Redis.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)