com.fastchar.extend.redis.jedis.FastJedisConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastchar Show documentation
Show all versions of fastchar Show documentation
FastChar is Web+ORM Framework in Java.
package com.fastchar.extend.redis.jedis;
import com.fastchar.interfaces.IFastConfig;
import redis.clients.jedis.ConnectionPoolConfig;
import redis.clients.jedis.JedisPoolConfig;
import java.time.Duration;
public class FastJedisConfig implements IFastConfig {
private String masterName;
private JedisPoolConfig jedisPoolConfig = new JedisPoolConfig();
private ConnectionPoolConfig jedisClusterPoolConfig = new ConnectionPoolConfig();
public FastJedisConfig() {
jedisPoolConfig.setSoftMinEvictableIdleTime(Duration.ofMillis(60000));
jedisPoolConfig.setMinEvictableIdleTime(Duration.ofMillis(60000));
jedisPoolConfig.setTestWhileIdle(true);
jedisClusterPoolConfig.setSoftMinEvictableIdleTime(Duration.ofMillis(60000));
jedisClusterPoolConfig.setMinEvictableIdleTime(Duration.ofMillis(60000));
jedisClusterPoolConfig.setTestWhileIdle(true);
}
public JedisPoolConfig getJedisPoolConfig() {
return jedisPoolConfig;
}
public FastJedisConfig setJedisPoolConfig(JedisPoolConfig jedisPoolConfig) {
this.jedisPoolConfig = jedisPoolConfig;
return this;
}
public ConnectionPoolConfig getJedisClusterPoolConfig() {
return jedisClusterPoolConfig;
}
public FastJedisConfig setJedisClusterPoolConfig(ConnectionPoolConfig jedisClusterPoolConfig) {
this.jedisClusterPoolConfig = jedisClusterPoolConfig;
return this;
}
public String getMasterName() {
return masterName;
}
public FastJedisConfig setMasterName(String masterName) {
this.masterName = masterName;
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy