Authored by wangnan9279

ufo

package com.yoho.search.consumer.index.fullbuild.listener;
import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
import com.yoho.search.consumer.service.logicService.personal.PersonalVectorVersionManager;
import com.yoho.search.consumer.service.logicService.productIndex.IndexFieldBuilder;
import org.slf4j.Logger;
... ... @@ -29,8 +28,6 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I
private IndexRebuildListenerMgr indexRebuildListenerMgr;
@Autowired
private PersonalVectorVersionManager personalVectorVersionManager;
@Autowired
private BasicDataCacheService basicDataCacheService;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
... ... @@ -49,19 +46,6 @@ public class ProductIndexRebuildListener implements IYohoIndexRebuildListener, I
@Override
public void beforeRebuild() {
//for yoho in productIndex
basicDataCacheService.clearBrand();
basicDataCacheService.clearProductSort();
basicDataCacheService.clearShop();
basicDataCacheService.clearCsBrandKeyword();
//for TBL in productIndex
basicDataCacheService.clearTblBrand();
basicDataCacheService.clearTblSite();
basicDataCacheService.clearTblYohoSortRelation();
basicDataCacheService.clearSizeNameMap();
basicDataCacheService.clearSortMap();
//for UFO in productindex
//indexFieldBuilder.init()
indexFieldBuilderList.stream().forEach(indexFieldBuilder -> indexFieldBuilder.init());
}
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.search.base.utils.ConvertUtils;
import com.yoho.search.base.utils.EventReportEnum;
import com.yoho.search.consumer.index.increment.AbstractMqListener;
import com.yoho.search.consumer.service.daoService.ufo.UfoSearchSortRelationService;
import com.yoho.search.consumer.service.logicService.cache.BasicDataCacheService;
import com.yoho.search.core.message.beans.SearchMqConsumerListerner;
import com.yoho.search.dal.model.UfoSearchSortRelation;
import org.springframework.beans.factory.annotation.Autowired;
... ... @@ -20,6 +21,8 @@ public class UfoSearchSortRelationMqListener extends AbstractMqListener {
@Autowired
private UfoSearchSortRelationService ufoSearchSortRelationService;
@Autowired
private BasicDataCacheService basicDataCacheService;
@Override
protected EventReportEnum getEventReportEnum() {
... ... @@ -39,4 +42,9 @@ public class UfoSearchSortRelationMqListener extends AbstractMqListener {
}
ufoSearchSortRelationService.saveOrUpdate(ufoSearchSortRelation);
}
@Override
protected void doFinishConsume() {
basicDataCacheService.clearUfoSortRelation();
}
}
... ...