|
|
@@ -175,7 +175,7 @@ public class FlowPoolService {
|
|
|
for (Map.Entry<String, Double> entry : douHotLevelWeight.entrySet()) {
|
|
|
// 从流量池缓存中移除达到分发次数限制的视频ID
|
|
|
String itemKey = String.format(RedisKeyConstants.DouHot.ITEM_REDIS_KEY_FORMAT, RecallUtils.douHotProvinceConvert(province), entry.getKey());
|
|
|
- log.info("[DouHot view distribute count remove cache] key: {}, item: {}", itemKey, needRemoveVideoIds);
|
|
|
+ // log.info("[DouHot view distribute count remove cache] key: {}, item: {}", itemKey, needRemoveVideoIds);
|
|
|
redisTemplate.opsForZSet().remove(itemKey, needRemoveVideoIds.toArray());
|
|
|
}
|
|
|
});
|
|
|
@@ -185,20 +185,20 @@ public class FlowPoolService {
|
|
|
|
|
|
// 获取流量池中 全部热点宝视频
|
|
|
List<FlowPoolVideoInfo> allDouHotVideo = this.findAllDouHotVideoFromFlowPool();
|
|
|
- log.info("[DouHot video size]: {}", allDouHotVideo.size());
|
|
|
+ // log.info("[DouHot video size]: {}", allDouHotVideo.size());
|
|
|
|
|
|
// 获取省份与视频列表的映射,省份 -> [video]
|
|
|
Map<String, Map<String, List<FlowPoolVideoInfo>>> levelAndProvinceAndVideoMap = this.findAllVideoAndProvinceMapByAttribute(allDouHotVideo);
|
|
|
- for (Map.Entry<String, Map<String, List<FlowPoolVideoInfo>>> levelEntry : levelAndProvinceAndVideoMap.entrySet()) {
|
|
|
+ /*for (Map.Entry<String, Map<String, List<FlowPoolVideoInfo>>> levelEntry : levelAndProvinceAndVideoMap.entrySet()) {
|
|
|
levelAndProvinceAndVideoMap.forEach((key, value) -> log.info("[DouHot province video size]. level: {}, province: {}, video size: {}", levelEntry.getKey(), key, value.size()));
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 获取某个省份下所有视频的分数, 省份 -> video -> score
|
|
|
Map<String, Map<Long, Double>> videoInProvinceScore = this.findVideoInProvinceScore(allDouHotVideo);
|
|
|
|
|
|
// 获取视频的可分发数,videoId-flowPool -> viewCnt
|
|
|
Map<String, Integer> videoDistributeCount = this.findDouHotVideoDistributeCount(allDouHotVideo);
|
|
|
- log.info("[DouHot view distribute count size]: {}", videoDistributeCount.size());
|
|
|
+ // log.info("[DouHot view distribute count size]: {}", videoDistributeCount.size());
|
|
|
|
|
|
this.douHotVideoWriteRedis(levelAndProvinceAndVideoMap, videoInProvinceScore, videoDistributeCount);
|
|
|
}
|
|
|
@@ -287,7 +287,7 @@ public class FlowPoolService {
|
|
|
paramJson.put("pageSize", 1000);
|
|
|
paramJson.put("pageNum", pageNum++);
|
|
|
|
|
|
- log.info("[get DouHot flow pool video] paramJson:{}", paramJson);
|
|
|
+ // log.info("[get DouHot flow pool video] paramJson:{}", paramJson);
|
|
|
CommonResponse<List<FlowPoolVideoInfo>> response = flowPoolFeign.getFlowPoolVideo(paramJson);
|
|
|
if (0 != response.getCode()) {
|
|
|
log.error("[get DouHot flow pool video request error] responseJson: {}", response);
|
|
|
@@ -295,7 +295,7 @@ public class FlowPoolService {
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isEmpty(response.getData())) {
|
|
|
- log.error("[get DouHot flow pool video data is empty] responseJson: {}", response);
|
|
|
+ // log.error("[get DouHot flow pool video data is empty] responseJson: {}", response);
|
|
|
break;
|
|
|
}
|
|
|
result.addAll(response.getData());
|
|
|
@@ -337,7 +337,7 @@ public class FlowPoolService {
|
|
|
.collect(Collectors.toMap(i -> RecallUtils.douHotProvinceConvert(i.getName()), DouHotVideoProvince::getTgi, (o1, o2) -> o1)))
|
|
|
)
|
|
|
);
|
|
|
- vidAndProvinceListMap.forEach((key, value) -> log.info("[DouHot vid and province mapping]: vid: {}, province: {}", key, JSON.toJSONString(value)));
|
|
|
+ // vidAndProvinceListMap.forEach((key, value) -> log.info("[DouHot vid and province mapping]: vid: {}, province: {}", key, JSON.toJSONString(value)));
|
|
|
Map<Long, Map<String, Double>> resultMap = new HashMap<>(videoIdAndVidMap.size());
|
|
|
for (Map.Entry<Long, String> entry : videoIdAndVidMap.entrySet()) {
|
|
|
Long videoId = entry.getKey();
|
|
|
@@ -429,7 +429,7 @@ public class FlowPoolService {
|
|
|
List<FlowPoolVideoInfo> flowPoolVideoInfos = entry.getValue();
|
|
|
|
|
|
String redisKey = String.format(RedisKeyConstants.DouHot.ITEM_REDIS_KEY_FORMAT, province, level);
|
|
|
- log.info("[DouHot item redis key]: redisKey: {}, video size: {}", redisKey, flowPoolVideoInfos.size());
|
|
|
+ // log.info("[DouHot item redis key]: redisKey: {}, video size: {}", redisKey, flowPoolVideoInfos.size());
|
|
|
redisTemplate.delete(redisKey);
|
|
|
|
|
|
Map<Long, Double> videoScoreInProvince = provinceAllVideoScore.getOrDefault(province, new HashMap<>());
|