All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastchar.extend.redis.jedis.FastJedisConfig Maven / Gradle / Ivy

There is a newer version: 2.2.2
Show newest version
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