...
|
...
|
@@ -164,14 +164,15 @@ public class TblProductNewIndexBuilder extends IIndexBuilder { |
|
|
* 增量构建
|
|
|
*/
|
|
|
public List<ProductIndexBO> getProductIndex(List<Integer> skns) {
|
|
|
logger.info("[tblProduct increase begin]########################################################################################################]");
|
|
|
long begin = System.currentTimeMillis();
|
|
|
logger.info("[###########################][TblProductNewIndexBuilder.getProductIndex][increase begin]");
|
|
|
List<TblProduct> tblProducts = tblProductService.getByskns(skns);
|
|
|
if (CollectionUtils.isEmpty(tblProducts)) {
|
|
|
return new ArrayList<>();
|
|
|
}
|
|
|
List<ProductIndexBO> productIndexBOS = buildProductIndex(tblProducts);
|
|
|
logger.info("[###########################]TblProductNewIndexBuilder.getProductIndex [increase end],[size:{}],[cost: {}]", System.currentTimeMillis() - begin);
|
|
|
logger.info("[fun=TblProductNewIndexBuilder.getProductIndex],[size:{}],[cost: {}]", System.currentTimeMillis() - begin);
|
|
|
logger.info("[tblProduct increase begin]########################################################################################################]");
|
|
|
return productIndexBOS;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -181,7 +182,6 @@ public class TblProductNewIndexBuilder extends IIndexBuilder { |
|
|
public List<ProductIndexBO> buildProductIndex(List<TblProduct> tblProducts) {
|
|
|
List<ProductIndexBO> productIndexBOs = new ArrayList<>();
|
|
|
try {
|
|
|
logger.info("[TblProductNewIndexBuilder.buildProductIndex] get data from cache begin");
|
|
|
long begin = System.currentTimeMillis();
|
|
|
JSONObject jsonObject = cache.get(CACHE_KEY);
|
|
|
if (jsonObject != null) {
|
...
|
...
|
@@ -194,7 +194,7 @@ public class TblProductNewIndexBuilder extends IIndexBuilder { |
|
|
sortIdOrderByMap = (Map<Integer, ProductSort>) jsonObject.get(SORTIDORDERBY_CACHE_KEY);
|
|
|
sortMapList = (List<HashMap<Integer, Integer>>) jsonObject.get(SORTMAPLIST_CACHE_KEY);
|
|
|
}
|
|
|
logger.info("[TblProductNewIndexBuilder.buildProductIndex]get data from cache end [cost: {}]",System.currentTimeMillis() - begin);
|
|
|
logger.info("[TblProductNewIndexBuilder.buildProductIndex]get map from cache end [cost: {}]",System.currentTimeMillis() - begin);
|
|
|
Map<Integer, List<TblProductSkc>> tblProductSkcMap = tblProductSkcMapBuilder.build(tblProducts);
|
|
|
Map<Integer, List<TblProductSku>> tblProductSkuMap = tblProductSkuMapBuilder.build(tblProducts);
|
|
|
// 生成ProductIndexBO
|
...
|
...
|
|