|
@@ -28,12 +28,10 @@ public class FlowPoolWithLevelSupplyRecallStrategy extends AbstractFlowPoolWithL
|
|
|
Pair<String, String> flowPoolKeyAndLevel(RecallParam param) {
|
|
|
//# 1. 获取流量池各层级分发概率权重
|
|
|
Map<String, Double> levelWeightMap = flowPoolConfigService.getLevelWeight();
|
|
|
- log.info("supply flowpool levelWeightMap = {}", levelWeightMap);
|
|
|
// 2. 判断各层级是否有视频需分发
|
|
|
List<LevelWeight> availableLevels = new ArrayList<>();
|
|
|
for (Map.Entry<String, Double> entry : levelWeightMap.entrySet()) {
|
|
|
String levelKey = String.format(KEY_WITH_LEVEL_SUPPLY_FORMAT, param.getAppType(), entry.getKey());
|
|
|
- log.info("supply flowpool levelKey = {}", levelKey);
|
|
|
if (redisTemplate.hasKey(levelKey)) {
|
|
|
LevelWeight lw = new LevelWeight();
|
|
|
lw.setLevel(entry.getKey());
|
|
@@ -42,7 +40,6 @@ public class FlowPoolWithLevelSupplyRecallStrategy extends AbstractFlowPoolWithL
|
|
|
availableLevels.add(lw);
|
|
|
}
|
|
|
}
|
|
|
- log.info("supply flowpool availableLevels = {}", availableLevels);
|
|
|
if (CollectionUtils.isEmpty(availableLevels)) {
|
|
|
return Pair.of("", "");
|
|
|
}
|
|
@@ -74,7 +71,6 @@ public class FlowPoolWithLevelSupplyRecallStrategy extends AbstractFlowPoolWithL
|
|
|
for (Map.Entry<String, LevelP> entry : level_p_mapping.entrySet()) {
|
|
|
if (random_p >= entry.getValue().getMin()
|
|
|
&& random_p <= entry.getValue().getMax()) {
|
|
|
- log.info("supply flowpool result {} {}", entry.getKey(), entry.getValue());
|
|
|
return Pair.of(entry.getValue().getLevelKey(), entry.getKey());
|
|
|
}
|
|
|
}
|