public static Pool < Jedis > createJedisPool ( final Config jesqueConfig , final GenericObjectPoolConfig poolConfig ) { if ( jesqueConfig == null ) { throw new IllegalArgumentException ( "jesqueConfig must not be null" ) ; } if ( poolConfig == null ) { throw new IllegalArgumentException ( "poolConfig must not be null" ) ; } if ( jesqueConfig . getMasterName ( ) != null && ! "" . equals ( jesqueConfig . getMasterName ( ) ) && jesqueConfig . getSentinels ( ) != null && jesqueConfig . getSentinels ( ) . size ( ) > 0 ) { return new JedisSentinelPool ( jesqueConfig . getMasterName ( ) , jesqueConfig . getSentinels ( ) , poolConfig , jesqueConfig . getTimeout ( ) , jesqueConfig . getPassword ( ) , jesqueConfig . getDatabase ( ) ) ; } else { return new JedisPool ( poolConfig , jesqueConfig . getHost ( ) , jesqueConfig . getPort ( ) , jesqueConfig . getTimeout ( ) , jesqueConfig . getPassword ( ) , jesqueConfig . getDatabase ( ) ) ; } }
A simple helper method that creates a pool of connections to Redis using the supplied configurations .