...
|
...
|
@@ -54,8 +54,6 @@ public class SknRecallCacheBean { |
|
|
try {
|
|
|
if (recommedSknList == null || recommedSknList.isEmpty()) {
|
|
|
return new ArrayList<>();
|
|
|
//localhost:8080/yohosearch/productindex/productList.json?uid=11145&status=1&gender=1,2,3,4,5
|
|
|
//recommedSknList = Arrays.asList(50020667, 50026235);
|
|
|
}
|
|
|
List<Integer> filterSknList;
|
|
|
if (recallWithCache) {
|
...
|
...
|
@@ -95,20 +93,18 @@ public class SknRecallCacheBean { |
|
|
RECALL_NEW_LOGGER.info("filterSknBy EhCache success");
|
|
|
return this.filterSknByCacheQueryResult(recommedSknList, productSknToIdMap, ehcacheQueryResult);
|
|
|
}
|
|
|
|
|
|
// //3、再从redis的bitset缓存结构中过滤
|
|
|
// Map<Integer, Boolean> redisQueryResult = searchRedis.getFromBitSet(redisKeyBuilder, recommedProductIds);
|
|
|
// if (redisQueryResult != null) {
|
|
|
// RECALL_NEW_LOGGER.info("filterSknBy Redis success");
|
|
|
// return this.filterSknByCacheQueryResult(recommedSknList, productSknToIdMap, redisQueryResult);
|
|
|
// }
|
|
|
//3、再从redis的bitset缓存结构中过滤
|
|
|
Map<Integer, Boolean> redisQueryResult = searchRedis.getFromBitSet(redisKeyBuilder, recommedProductIds);
|
|
|
if (redisQueryResult != null) {
|
|
|
RECALL_NEW_LOGGER.info("filterSknBy Redis success");
|
|
|
return this.filterSknByCacheQueryResult(recommedSknList, productSknToIdMap, redisQueryResult);
|
|
|
}
|
|
|
//4、执行查询,添加到缓存
|
|
|
PageProductIdBitSet pageProductIdBitSet = pageProductIdBitSetComponent.queryPageProductIdBitSet(userRecallRequest.getParamQueryFilter());
|
|
|
|
|
|
//4.1)添加到本地缓存
|
|
|
this.ehCache.setBitSet(redisKeyBuilder, pageProductIdBitSet.getProductIdBitSet(), pageProductIdBitSetComponent.cacheTimeInMinute());
|
|
|
// //4.2)异步添加到redis缓存
|
|
|
// this.searchRedis.setBitSet(redisKeyBuilder, pageProductIdBitSet.getProductIdBitSet(), pageProductIdBitSetComponent.cacheTimeInMinute());
|
|
|
//4.2)异步添加到redis缓存
|
|
|
this.searchRedis.setBitSet(redisKeyBuilder, pageProductIdBitSet.getProductIdBitSet(), pageProductIdBitSetComponent.cacheTimeInMinute());
|
|
|
return this.filterSknByPageProductIdBitSet(recommedSknList, productSknToIdMap, pageProductIdBitSet.getProductIdBitSet());
|
|
|
}
|
|
|
|
...
|
...
|
|