|
@@ -105,6 +105,9 @@ public class RecommendService {
|
|
@ApolloJsonValue("${risk.scene:[]}")
|
|
@ApolloJsonValue("${risk.scene:[]}")
|
|
private Set<Long> riskScenes;
|
|
private Set<Long> riskScenes;
|
|
|
|
|
|
|
|
+ @Value("${flow.pool.upgrade.switch:true}")
|
|
|
|
+ private boolean flowPoolUpgradeSwitch;
|
|
|
|
+
|
|
private LoadingCache<String, Set<String>> riskUserCache = CacheBuilder.newBuilder()
|
|
private LoadingCache<String, Set<String>> riskUserCache = CacheBuilder.newBuilder()
|
|
.maximumSize(5)
|
|
.maximumSize(5)
|
|
.refreshAfterWrite(300, TimeUnit.SECONDS)
|
|
.refreshAfterWrite(300, TimeUnit.SECONDS)
|
|
@@ -396,21 +399,12 @@ public class RecommendService {
|
|
int flowPoolIdChoice = flowPoolIds.get(RandomUtils.nextInt(0, flowPoolIds.size()));
|
|
int flowPoolIdChoice = flowPoolIds.get(RandomUtils.nextInt(0, flowPoolIds.size()));
|
|
Map<String, List<Integer>> flowPoolConfig = flowPoolConfigService.getFlowPoolConfig();
|
|
Map<String, List<Integer>> flowPoolConfig = flowPoolConfigService.getFlowPoolConfig();
|
|
Set<String> abExpCodes = param.getAbExpCodes();
|
|
Set<String> abExpCodes = param.getAbExpCodes();
|
|
- if (Objects.nonNull(abExpCodes) && abExpCodes.contains(Constant.SUPPLY_AB_CODE_ID)) {
|
|
|
|
-// if (Objects.equals(Constant.SUPPLY_AB_CODE, param.getAbCode())) {
|
|
|
|
- List<Integer> supplyFlowPoolIdList = flowPoolConfig.get(FlowPoolConstants.SUPPLY_FLOW_SET_LEVEL);
|
|
|
|
- if (Objects.nonNull(supplyFlowPoolIdList) && !supplyFlowPoolIdList.isEmpty()) {
|
|
|
|
- flowPoolIdChoice = supplyFlowPoolIdList.get(0);
|
|
|
|
- param.setFlowPoolId(flowPoolIdChoice);
|
|
|
|
- param.setFlowPoolAbtestGroup(FlowPoolConstants.SUPPLY_FLOW_SET_LEVEL);
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- param.setFlowPoolId(flowPoolIdChoice);
|
|
|
|
- param.setFlowPoolAbtestGroup("control_group");
|
|
|
|
- for (Map.Entry<String, List<Integer>> entry : flowPoolConfig.entrySet()) {
|
|
|
|
- if (entry.getValue().contains(flowPoolIdChoice)) {
|
|
|
|
- param.setFlowPoolAbtestGroup(entry.getKey());
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ param.setFlowPoolId(flowPoolIdChoice);
|
|
|
|
+ param.setFlowPoolAbtestGroup("control_group");
|
|
|
|
+ for (Map.Entry<String, List<Integer>> entry : flowPoolConfig.entrySet()) {
|
|
|
|
+ if (entry.getValue().contains(flowPoolIdChoice)) {
|
|
|
|
+ param.setFlowPoolAbtestGroup(entry.getKey());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// @desc 新的流量池分发实验组划分,每个尾号不同策略分组。 @time 20240318 @author 张博
|
|
// @desc 新的流量池分发实验组划分,每个尾号不同策略分组。 @time 20240318 @author 张博
|
|
@@ -570,6 +564,8 @@ public class RecommendService {
|
|
recallParam.setHotSceneType(param.getHotSceneType());
|
|
recallParam.setHotSceneType(param.getHotSceneType());
|
|
recallParam.setClientIp(param.getClientIp());
|
|
recallParam.setClientIp(param.getClientIp());
|
|
|
|
|
|
|
|
+ recallParam.setFlowPoolUpgrade(flowPoolUpgradeSwitch);
|
|
|
|
+
|
|
return recallParam;
|
|
return recallParam;
|
|
}
|
|
}
|
|
|
|
|