|  | @@ -1,4 +1,5 @@
 | 
	
		
			
				|  |  |  package com.tzld.piaoquan.recommend.server.service.recall;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 | 
	
		
			
				|  |  |  import com.tzld.piaoquan.recommend.server.common.ThreadPoolFactory;
 | 
	
		
			
				|  |  |  import com.tzld.piaoquan.recommend.server.common.base.Constant;
 | 
	
	
		
			
				|  | @@ -7,6 +8,8 @@ import com.tzld.piaoquan.recommend.server.model.Video;
 | 
	
		
			
				|  |  |  import com.tzld.piaoquan.recommend.server.service.filter.strategy.BlacklistContainer;
 | 
	
		
			
				|  |  |  import com.tzld.piaoquan.recommend.server.service.flowpool.FlowPoolConstants;
 | 
	
		
			
				|  |  |  import com.tzld.piaoquan.recommend.server.service.recall.strategy.*;
 | 
	
		
			
				|  |  | +import com.tzld.piaoquan.recommend.server.util.CommonCollectionUtils;
 | 
	
		
			
				|  |  | +import com.tzld.piaoquan.recommend.server.util.JSONUtils;
 | 
	
		
			
				|  |  |  import lombok.extern.slf4j.Slf4j;
 | 
	
		
			
				|  |  |  import org.apache.commons.collections.CollectionUtils;
 | 
	
		
			
				|  |  |  import org.apache.commons.lang3.StringUtils;
 | 
	
	
		
			
				|  | @@ -57,11 +60,18 @@ public class RecallService implements ApplicationContextAware {
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      public RecallResult recall(RecallParam param) {
 | 
	
		
			
				|  |  |          List<RecallStrategy> strategies = getRecallStrategy(param);
 | 
	
		
			
				|  |  | +//        log.info("strategies {}", JSONUtils.toJson(CommonCollectionUtils.toList(strategies,
 | 
	
		
			
				|  |  | +//        o -> o.getClass().getSimpleName())));
 | 
	
		
			
				|  |  |          CountDownLatch cdl = new CountDownLatch(strategies.size());
 | 
	
		
			
				|  |  |          List<Future<RecallResult.RecallData>> recallResultFutures = new ArrayList<>();
 | 
	
		
			
				|  |  |          for (final RecallStrategy strategy : strategies) {
 | 
	
		
			
				|  |  |              Future<RecallResult.RecallData> future = pool.submit(() -> {
 | 
	
		
			
				|  |  | -                List<Video> result = strategy.recall(param);
 | 
	
		
			
				|  |  | +                List<Video> result = Collections.emptyList();
 | 
	
		
			
				|  |  | +                try {
 | 
	
		
			
				|  |  | +                    result = strategy.recall(param);
 | 
	
		
			
				|  |  | +                } catch (Throwable e) {
 | 
	
		
			
				|  |  | +                    log.error("recall error {}", strategy.getClass().getSimpleName(), e);
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  |                  cdl.countDown();
 | 
	
		
			
				|  |  |                  return new RecallResult.RecallData(strategy.pushFrom(), result);
 | 
	
		
			
				|  |  |              });
 | 
	
	
		
			
				|  | @@ -94,9 +104,9 @@ public class RecallService implements ApplicationContextAware {
 | 
	
		
			
				|  |  |              return strategies;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -            String matchUserBlacklistTypeEnum = blacklistContainer.matchUserBlacklistTypeEnum(param.getUid(), param.getHotSceneType(), param.getCityCode(),
 | 
	
		
			
				|  |  | -                    param.getClientIp(), param.getMid(), "recommend-flow-pool", param.getAppType());
 | 
	
		
			
				|  |  | -        boolean hitUserBlacklist =  StringUtils.isNotBlank(matchUserBlacklistTypeEnum);
 | 
	
		
			
				|  |  | +        String matchUserBlacklistTypeEnum = blacklistContainer.matchUserBlacklistTypeEnum(param.getUid(), param.getHotSceneType(), param.getCityCode(),
 | 
	
		
			
				|  |  | +                param.getClientIp(), param.getMid(), "recommend-flow-pool", param.getAppType());
 | 
	
		
			
				|  |  | +        boolean hitUserBlacklist = StringUtils.isNotBlank(matchUserBlacklistTypeEnum);
 | 
	
		
			
				|  |  |          boolean isInBlacklist = CollectionUtils.isNotEmpty(blacklistAppTypeSet) && blacklistAppTypeSet.contains(param.getAppType());
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |          String abCode = param.getAbCode();
 | 
	
	
		
			
				|  | @@ -361,13 +371,13 @@ public class RecallService implements ApplicationContextAware {
 | 
	
		
			
				|  |  |          this.applicationContext = applicationContext;
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -    private boolean matchSpecialApp(int appId){
 | 
	
		
			
				|  |  | +    private boolean matchSpecialApp(int appId) {
 | 
	
		
			
				|  |  |          Set<Integer> notSpecialApp = new HashSet<>(Arrays.asList(0, 4, 5));
 | 
	
		
			
				|  |  | -        if (notSpecialApp.contains(appId)){
 | 
	
		
			
				|  |  | +        if (notSpecialApp.contains(appId)) {
 | 
	
		
			
				|  |  |              // vlog 票圈视频 内容精选 不允许走特殊列表,即使配置了也无效。
 | 
	
		
			
				|  |  |              return false;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  | -        if (specialAppVid != null && specialAppVid.getOrDefault("app", new ArrayList<>()).contains((long) appId)){
 | 
	
		
			
				|  |  | +        if (specialAppVid != null && specialAppVid.getOrDefault("app", new ArrayList<>()).contains((long) appId)) {
 | 
	
		
			
				|  |  |              log.info("This request hits a special logic in matchSpecialApp with appId={}", appId);
 | 
	
		
			
				|  |  |              return true;
 | 
	
		
			
				|  |  |          }
 |