...
|
...
|
@@ -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();
|
|
|
|
...
|
...
|
|