Authored by Gino Zhang

增加一个强制执行pi个性化数据更新的restful接口

... ... @@ -100,8 +100,13 @@ public class ProductVectorFeatureJob {
return;
}
doUpdateProductIndexVector();
}
public void doUpdateProductIndexVector() {
long begin = System.currentTimeMillis();
RetryBusinessFlowExecutor flowExecutor = new RetryBusinessFlowExecutor(productIndexFeatureVectorUpdateFlow, ISearchConstants.SEARCH_INDEX_BATCH_MAX_THREAD_SIZE, ISearchConstants.SEARCH_INDEX_BATCH_LIMIT);
boolean result = flowExecutor.execute();
logger.info("ProductVectorFeatureJob.updateProductIndexVector end----[result={}][cost={}]", result, System.currentTimeMillis() - begin);
logger.info("ProductVectorFeatureJob.doUpdateProductIndexVector end----[result={}][cost={}]", result, System.currentTimeMillis() - begin);
}
}
... ...
... ... @@ -9,8 +9,8 @@ import com.yoho.search.base.utils.ISearchConstants;
import com.yoho.search.base.utils.MD5Util;
import com.yoho.search.consumer.index.common.IYohoIndexService;
import com.yoho.search.consumer.index.rebuild.RebuildFlagService;
import com.yoho.search.consumer.job.ProductVectorFeatureJob;
import com.yoho.search.consumer.job.IndexRebuildJob;
import com.yoho.search.consumer.job.ProductVectorFeatureJob;
import com.yoho.search.consumer.job.SuggestionJob;
import com.yoho.search.consumer.service.base.ProductIndexService;
import com.yoho.search.consumer.service.base.SuggestWordDefService;
... ... @@ -351,9 +351,13 @@ public class IndexController implements ApplicationEventPublisherAware {
@RequestMapping(value = "/index/updateProductIndexVector")
@ResponseBody
public Map<String, Object> updateProductIndexVector() {
public Map<String, Object> updateProductIndexVector(@RequestParam(defaultValue = "false") boolean force) {
try {
productVectorFeatureJob.updateProductIndexVector();
if (force) {
productVectorFeatureJob.doUpdateProductIndexVector();
} else {
productVectorFeatureJob.updateProductIndexVector();
}
return getResultMap(200, "success");
} catch (Exception e) {
logger.error(e.getMessage(), e);
... ...