...
|
...
|
@@ -46,22 +46,23 @@ public abstract class AbstractSuggestionCounter implements ApplicationEventPubli |
|
|
@Override
|
|
|
public boolean doBusiness(int pageNo, int batchSize) {
|
|
|
Map<String, Object> keywordMap = getKeywordMap(pageNo, batchSize);
|
|
|
int size = keywordMap != null ? keywordMap.size() : 0;
|
|
|
logger.info("[{} business][pageNo={}][wordSize={}]", flowName(), pageNo, size);
|
|
|
logger.trace("[{} business][pageNo={}][keywordMap={}]", flowName(), pageNo, keywordMap);
|
|
|
if (size == 0) {
|
|
|
int fetchSize = keywordMap != null ? keywordMap.size() : 0;
|
|
|
if (fetchSize == 0) {
|
|
|
logger.info("[{} business][pageNo={}][fetchWordSize={}]", flowName(), pageNo, fetchSize);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
Map<String, Integer> countMap = keywordCounterService.batchCount(keywordMap.keySet().stream().collect(Collectors.toList()));
|
|
|
size = countMap != null ? countMap.size() : 0;
|
|
|
logger.info("[{} business][pageNo={}][countMapSize={}]", flowName(), pageNo, size);
|
|
|
logger.trace("[{} business][pageNo={}][countMap={}]", flowName(), pageNo, countMap);
|
|
|
if (size == 0) {
|
|
|
int countMapSize = countMap != null ? countMap.size() : 0;
|
|
|
if (countMapSize == 0) {
|
|
|
logger.info("[{} business][pageNo={}][countMapSize={}]", flowName(), pageNo, countMapSize);
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
return persistence(keywordMap, filter(pageNo, countMap));
|
|
|
Map<String, Integer> filterMap = filter(pageNo, countMap);
|
|
|
logger.info("[{} business][pageNo={}][fetchWordSize={}][countMapSize={}][countMapSize={}]", flowName(), pageNo, fetchSize, countMapSize, filterMap.size());
|
|
|
logger.trace("[{} business][pageNo={}][keywordMap={}][countMap={}][filterMap={}]", flowName(), pageNo, keywordMap, countMap, filterMap);
|
|
|
return persistence(keywordMap, filterMap);
|
|
|
}
|
|
|
|
|
|
protected Map<String, Integer> filter(int pageNo, Map<String, Integer> countMap) {
|
...
|
...
|
@@ -73,8 +74,6 @@ public abstract class AbstractSuggestionCounter implements ApplicationEventPubli |
|
|
}
|
|
|
});
|
|
|
|
|
|
logger.info("[{} business][pageNo={}][filterMapSize={}]", flowName(), pageNo, countMap.size(), filterMap.size());
|
|
|
logger.trace("[{} business][pageNo={}][filterMap={}]", flowName(), pageNo, filterMap);
|
|
|
return filterMap;
|
|
|
}
|
|
|
|
...
|
...
|
|