Authored by Zhao

add zk get

... ... @@ -56,6 +56,7 @@ public class RecallStrategyLogicService {
String configStr = "";
try {
configStr = JsonUtil.toJson(list);
LOGGER.info("publish recall strategy data " + configStr + " to zk");
zkConfigService.addStringValueToZk(RECALL_STRATEGY_CONFIGKEY, configStr);
} catch (Exception e) {
LOGGER.error("publish recall strategy data " + configStr + " to zk failed!", e);
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.search.consumer.test;
import com.yoho.search.consumer.index.increment.bulks.CommonBulkService;
import com.yoho.search.consumer.job.CleanDataJob;
import com.yoho.search.consumer.service.logicService.RecallStrategyLogicService;
import com.yoho.search.dal.SknImageVectorsMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -80,4 +81,15 @@ public class TestApiController {
// JSONObject jsonObject = new JSONObject(indexData);
// commonBulkService.add(new ESBluk(jsonObject.toJSONString(), skn, "images_test", "images_test", false));
// }
@Autowired
private RecallStrategyLogicService recallStrategyLogicService;
@RequestMapping(value = "/test2")
@ResponseBody
public String test2() {
String result = recallStrategyLogicService.getRecallStrategyConfigInZk();
return result;
}
}
... ...