Hi,
There are some points that my be worth further discussion. They are:
1. the cache loader size method return type is limited to int. Redis servers can hold much more than Integer.MAX_VALUE and the Jedis client method for counting items on the Redis server returns longs for each server, which in addition must be totalled up for each server if using a Redis cluster topology. To get around this I am checking for a long over Integer.MAX_VALUE and logging a warn, then returning Integer.MAX_VALUE.
2. Redis handles expiration. I am using lifespan to immediately set the expiration of the cache entry in Redis, and when that lifespan is reached the item is immediately purged by Redis itself. This means, there is no idle time, and there is no purge method implementation.
3. A few unit tests around expiration had to be disabled as they require changes to time. As expiration is handled by Redis, I would have to change the system time to make Redis force expiration. For now, they are just disabled.
I have built it against the Jedis client. I also tried 2 other clients, lettuce and redisson, but felt that Jedis gave the best implementation as a) it didn't try to do too much (by this I mean running background monitoring threads that try to detect failure and perform automatic failover of Redis slaves) and b) had all the API features I needed to make the implementation work efficiently.
Jedis supports 3 main modes of operation. They are, single server, Redis sentinel and Redis cluster. Redis versions that should be supported are 2.8+ and 3.0+.
I haven't tested this beyond the unit tests distributed with Infinispan which are starting full Redis servers in single server, sentinel and cluster configurations to run the tests, but I am hoping to start working on getting integration in to Wildfly 10, which I can test with a cache container for web sessions and a simple counter web app.
Regards
Simon