|
@@ -53,12 +53,6 @@ public class RecommendService {
|
|
|
@Qualifier("redisTemplate")
|
|
|
private RedisTemplate<String, String> redisTemplate;
|
|
|
|
|
|
-
|
|
|
- private final Map<Integer, String> ab_initial_config_map = new HashMap<>();
|
|
|
-
|
|
|
- @ApolloJsonValue("${ab_exp_code:{}}")
|
|
|
- private Map<String, Map<String, String>> abExpCodeMap;
|
|
|
-
|
|
|
@ApolloJsonValue("${app_ab_code:{}}")
|
|
|
private Map<String, Map<String, Map<String, String>>> appAbCodeMap;
|
|
|
|
|
@@ -156,7 +150,6 @@ public class RecommendService {
|
|
|
updateCache(request, param, videos);
|
|
|
long updateCacheTime = stopwatch.elapsed(TimeUnit.MILLISECONDS);
|
|
|
timerLogMapTL.get().put("updateCacheTime", updateCacheTime);
|
|
|
- timerLogMapTL.get().put("abCodeFake", param.getAbCode());
|
|
|
timerLogService.log(timerLogMapTL.get());
|
|
|
logStatisticsInfo(request, param, videos);
|
|
|
// 更新position
|
|
@@ -174,7 +167,6 @@ public class RecommendService {
|
|
|
vps.add(VideoProto.newBuilder()
|
|
|
.setPosition(i + 1)
|
|
|
.setPushFrom(Strings.nullToEmpty(videos.get(i).getPushFrom()))
|
|
|
- .setAbCode(Strings.nullToEmpty(videos.get(i).getAbCode()))
|
|
|
.setVideoId(videos.get(i).getVideoId())
|
|
|
.setRovScore(videos.get(i).getRovScore())
|
|
|
.setSortScore(videos.get(i).getSortScore())
|
|
@@ -299,7 +291,6 @@ public class RecommendService {
|
|
|
.setResult(Result.newBuilder().setCode(1).setMessage("success"))
|
|
|
.addAllVideo(CommonCollectionUtils.toList(videos, v -> VideoProto.newBuilder()
|
|
|
.setPushFrom(Strings.nullToEmpty(v.getPushFrom()))
|
|
|
- .setAbCode(Strings.nullToEmpty(v.getAbCode()))
|
|
|
.setVideoId(v.getVideoId())
|
|
|
.setRovScore(v.getRovScore())
|
|
|
.build()))
|
|
@@ -321,11 +312,8 @@ public class RecommendService {
|
|
|
param.setCity(request.getCity());
|
|
|
|
|
|
|
|
|
- String abInitialConfig = ab_initial_config_map.getOrDefault(request.getAppType(), "095-1");
|
|
|
- Map<String, String> abExpCode = abExpCodeMap.getOrDefault(abInitialConfig, Collections.emptyMap());
|
|
|
- param.setAbCode(abExpCode.get("ab_code"));
|
|
|
- param.setRuleKey(abExpCode.get("rule_key"));
|
|
|
- param.setDataKey(abExpCode.get("data_key"));
|
|
|
+ param.setRuleKey("data66");
|
|
|
+ param.setDataKey("rule66");
|
|
|
param.setRankKeyPrefix("rank:score1:");
|
|
|
|
|
|
// 实验配置
|
|
@@ -346,22 +334,6 @@ public class RecommendService {
|
|
|
} else if (abExpCodes.contains("339")) {
|
|
|
param.setFlowPoolP(0);
|
|
|
}
|
|
|
-
|
|
|
- for (Map.Entry<String, Map<String, String>> entry : abExpCodeMap.entrySet()) {
|
|
|
- if (abExpCodes.contains(entry.getKey())) {
|
|
|
- param.setAbCode(entry.getValue().get("ab_code"));
|
|
|
- param.setRuleKey(entry.getValue().get("rule_key"));
|
|
|
- param.setDataKey(entry.getValue().get("data_key"));
|
|
|
-
|
|
|
- param.setHDataKey(entry.getValue().get("h_data_key"));
|
|
|
- param.setHRuleKey(entry.getValue().get("h_rule_key"));
|
|
|
-
|
|
|
- param.setRankKeyPrefix(StringUtils.isNotBlank(entry.getValue().get("rank_key_prefix"))
|
|
|
- ? entry.getValue().get("rank_key_prefix")
|
|
|
- : "rank:score1:");
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
// app实验组
|
|
@@ -372,7 +344,6 @@ public class RecommendService {
|
|
|
if (StringUtils.isNotBlank(eventId)
|
|
|
&& appAbCode != null
|
|
|
&& appAbCode.containsKey(eventId)) {
|
|
|
- param.setAbCode(appAbCode.get(eventId).get("ab_code"));
|
|
|
param.setRuleKey(appAbCode.get(eventId).get("rule_key"));
|
|
|
param.setDataKey(appAbCode.get(eventId).get("data_key"));
|
|
|
}
|
|
@@ -447,14 +418,6 @@ public class RecommendService {
|
|
|
if (param.getSize() < rankResult.getVideos().size()) {
|
|
|
videos = rankResult.getVideos().subList(0, param.getSize());
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- // mark video in flow pool
|
|
|
- // TODO 业务上有什么用处
|
|
|
- // 需要被标记的视频满足什么条件
|
|
|
- // 逻辑已经废弃
|
|
|
- // markFlowPoolVideo(param, videos);
|
|
|
-
|
|
|
return videos;
|
|
|
}
|
|
|
|
|
@@ -463,11 +426,8 @@ public class RecommendService {
|
|
|
recallParam.setAppType(param.getAppType());
|
|
|
// hard code 算法实验配置化之前,复用abcode做AB验证
|
|
|
// note 避免非实验产品被覆盖
|
|
|
- recallParam.setAbCode(param.getAbCode());
|
|
|
recallParam.setRuleKey(param.getRuleKey());
|
|
|
recallParam.setDataKey(param.getDataKey());
|
|
|
- recallParam.setHRuleKey(param.getHRuleKey());
|
|
|
- recallParam.setHDataKey(param.getHDataKey());
|
|
|
|
|
|
recallParam.setVideoId(param.getVideoId());
|
|
|
recallParam.setFlowPoolAbtestGroup(param.getFlowPoolAbtestGroup());
|
|
@@ -504,9 +464,6 @@ public class RecommendService {
|
|
|
public RankParam convertToRankParam(RecommendParam param, RecallResult recallResult) {
|
|
|
RankParam rankParam = new RankParam();
|
|
|
rankParam.setRecallResult(recallResult);
|
|
|
- // hard code 算法实验配置化之前,复用abcode做AB验证
|
|
|
- // note 避免非实验产品被覆盖
|
|
|
- rankParam.setAbCode(param.getAbCode());
|
|
|
rankParam.setRankKeyPrefix(param.getRankKeyPrefix());
|
|
|
|
|
|
rankParam.setSize(param.getSize());
|