RedissonSpringCacheManager
-
@Cacheable
: Triggers cache population. 增
对应RedissonSpringCacheManager中添加方法
-
@CacheEvict
: Triggers cache eviction. 删
对应RedissonSpringCacheManager中删除方法
-
@CachePut
: Updates the cache without interfering with the method execution. 改
对应RedissonSpringCacheManager中修改方法
caller 调用 computePiDecimal 方法, cacheManager找到缓存服务器,并调用缓存服务器适配 spring caching 机制的所提供的适配方法, 保存缓存数据。
需要提供key,不然key由simpleKeyGenerator生成一个随机的key
在调用computePiDecimal前,先查找当前有没有piDecimals缓存并且匹配i参数
如果找到缓存且匹配了i参数,则不用执行computePiDecimal方法,且直接返回缓存数据。