Authored by hugufei

rename

... ... @@ -20,7 +20,7 @@ public abstract class AbstractCacheConfigBean<ESObject, Cache> {
@PostConstruct
void init() {
schedule.scheduleAtFixedRate(() -> loadCache(), 0, 1, TimeUnit.MINUTES);
this.cache = newCacheObject();
this.cache = newTempCache();
}
protected void loadCache() {
... ... @@ -29,7 +29,7 @@ public abstract class AbstractCacheConfigBean<ESObject, Cache> {
long begin = System.currentTimeMillis();
RECALL_NEW_LOGGER.info(functionName + "begin ........");
List<ESObject> esObjectList = this.queryAllFromEs();
Cache tempCache = newCacheObject();
Cache tempCache = newTempCache();
for (ESObject esObject : esObjectList) {
addESObjectToTempCache(esObject, tempCache);
}
... ... @@ -40,7 +40,7 @@ public abstract class AbstractCacheConfigBean<ESObject, Cache> {
}
}
protected abstract Cache newCacheObject();
protected abstract Cache newTempCache();
protected abstract List<ESObject> queryAllFromEs();
... ...
... ... @@ -23,7 +23,7 @@ class ConfigBrandService extends AbstractCacheConfigBean<CsRecallConfigBrand, Li
private SearchCommonService searchCommonService;
@Override
protected List<Integer> newCacheObject() {
protected List<Integer> newTempCache() {
return new ArrayList<>();
}
... ...
... ... @@ -20,7 +20,7 @@ class ConfigSortBrandService extends AbstractCacheConfigBean<CsRecallConfigSortB
private SearchCommonService searchCommonService;
@Override
protected List<SortBrand> newCacheObject() {
protected List<SortBrand> newTempCache() {
return new ArrayList<>();
}
... ...
... ... @@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
... ... @@ -24,7 +25,7 @@ class ConfigSortPriceService extends AbstractCacheConfigBean<CsRecallConfigSortP
@Override
protected List<CsRecallConfigSortPrice> newCacheObject() {
protected List<CsRecallConfigSortPrice> newTempCache() {
return new ArrayList<>();
}
... ... @@ -58,7 +59,8 @@ class ConfigSortPriceService extends AbstractCacheConfigBean<CsRecallConfigSortP
if (size <= 0 || CollectionUtils.isEmpty(pageFactor.getMisortIds())) {
return new ArrayList<>();
}
List<CsRecallConfigSortPrice> copyList = new ArrayList<>(this.newCacheObject());
List<CsRecallConfigSortPrice> copyList = new ArrayList<>(this.getCache());
Collections.shuffle(copyList);
List<CsRecallConfigSortPrice> results = new ArrayList<>();
for (CsRecallConfigSortPrice sortPrice : copyList) {
if (results.size() >= size) {
... ...
... ... @@ -24,7 +24,7 @@ class SizeIntervalService extends AbstractCacheConfigBean<CsRecallConfigCommon,M
private SearchCommonService searchCommonService;
@Override
protected Map<String, Map<Integer, SizeInterval>> newCacheObject() {
protected Map<String, Map<Integer, SizeInterval>> newTempCache() {
return new HashMap<>();
}
... ...
... ... @@ -24,7 +24,7 @@ class SortBrandSknCountService extends AbstractCacheConfigBean<CsRecallConfigPro
private SearchCommonService searchCommonService;
@Override
protected Map<String, Map<Integer, SortBrandSknCount>> newCacheObject() {
protected Map<String, Map<Integer, SortBrandSknCount>> newTempCache() {
return new HashMap<>();
}
... ...