Authored by hugufei

添加日志

1 package com.yoho.search.recall.scene.beans.cache; 1 package com.yoho.search.recall.scene.beans.cache;
2 2
  3 +import com.alibaba.fastjson.JSON;
3 import com.yoho.search.recall.scene.beans.builder.*; 4 import com.yoho.search.recall.scene.beans.builder.*;
4 import com.yoho.search.recall.scene.beans.persional.QueryUserPersionalFactorBean; 5 import com.yoho.search.recall.scene.beans.persional.QueryUserPersionalFactorBean;
5 import com.yoho.search.recall.scene.models.common.RecallMergerResult; 6 import com.yoho.search.recall.scene.models.common.RecallMergerResult;
@@ -80,6 +81,19 @@ public class UserRecallRequestResponseCacheBean extends AbstractCacheBean<UserRe @@ -80,6 +81,19 @@ public class UserRecallRequestResponseCacheBean extends AbstractCacheBean<UserRe
80 begin = System.currentTimeMillis(); 81 begin = System.currentTimeMillis();
81 List<RecallRequestResponse> requestResponses = recallRequestResponseCacheBean.batchRecallAndCache(batchRequests); 82 List<RecallRequestResponse> requestResponses = recallRequestResponseCacheBean.batchRecallAndCache(batchRequests);
82 RECALL_NEW_LOGGER.info("UserRecallRequestResponseCacheBean[2]-batchRecallAndCache,cost is [{}]", System.currentTimeMillis()-begin); 83 RECALL_NEW_LOGGER.info("UserRecallRequestResponseCacheBean[2]-batchRecallAndCache,cost is [{}]", System.currentTimeMillis()-begin);
  84 + if(param.getUid()==13420925){
  85 + for(RecallRequestResponse recallRequestResponse: requestResponses){
  86 + StringBuilder responseLog = new StringBuilder();
  87 + RecallResponse recallResponse = recallRequestResponse.getResponse();
  88 + if(recallResponse==null){
  89 + responseLog.append("null");
  90 + }else{
  91 + responseLog.append("total is [").append(recallResponse.getTotal()).append("], ");
  92 + responseLog.append("sknList is ").append(recallResponse.getSkns()==null?"[]", JSON.toJSONString(recallResponse.getSkns()));
  93 + }
  94 + RECALL_NEW_LOGGER.info("request_type is [{}], response is [{}] ", recallRequestResponse.getRequest().requestStrategy().name(),responseLog);
  95 + }
  96 + }
83 //4、获取skn列表[去重] 97 //4、获取skn列表[去重]
84 RecallMergerResult recallMergerResult = recallMergerResultBuilder.buildRecallMergerResult(requestResponses); 98 RecallMergerResult recallMergerResult = recallMergerResultBuilder.buildRecallMergerResult(requestResponses);
85 //5、构造真实结果[排序,截取skn] 99 //5、构造真实结果[排序,截取skn]