优化代码
This commit is contained in:
		
							parent
							
								
									9e26db092e
								
							
						
					
					
						commit
						af422289d8
					
				| 
						 | 
				
			
			@ -28,6 +28,7 @@ import java.util.concurrent.CompletableFuture;
 | 
			
		|||
import java.util.concurrent.LinkedBlockingQueue;
 | 
			
		||||
import java.util.concurrent.ThreadPoolExecutor;
 | 
			
		||||
import java.util.concurrent.TimeUnit;
 | 
			
		||||
import java.util.concurrent.atomic.AtomicInteger;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @description:
 | 
			
		||||
| 
						 | 
				
			
			@ -58,7 +59,7 @@ public class RelationCompletion {
 | 
			
		|||
     */
 | 
			
		||||
    public void relationCompletion() {
 | 
			
		||||
        log.info("开始进行关系补全....");
 | 
			
		||||
        int allCount = 0;
 | 
			
		||||
        AtomicInteger allCount = new AtomicInteger();
 | 
			
		||||
        // 获取各个节点和边的数量
 | 
			
		||||
        //post_in_task
 | 
			
		||||
        ShowStatsVo stats = showStats();
 | 
			
		||||
| 
						 | 
				
			
			@ -66,8 +67,14 @@ public class RelationCompletion {
 | 
			
		|||
        // 新起一个nebula session池
 | 
			
		||||
        SessionPool sessionPool = graphCommonService.newPoolConfig();
 | 
			
		||||
        boolean isComplete = false;
 | 
			
		||||
        Map<String, Boolean> completeMap = new HashMap();
 | 
			
		||||
        while (true) {
 | 
			
		||||
            if (allCount == 5) {
 | 
			
		||||
            completeMap.forEach((k, v) -> {
 | 
			
		||||
                if (v) {
 | 
			
		||||
                    allCount.getAndIncrement();
 | 
			
		||||
                }
 | 
			
		||||
            });
 | 
			
		||||
            if (allCount.get() == 5) {
 | 
			
		||||
                log.info("关系补全全部结束...");
 | 
			
		||||
                break;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -85,7 +92,7 @@ public class RelationCompletion {
 | 
			
		|||
                if (tagNumsMap.get(tag) < skip) {
 | 
			
		||||
                    FileCacheManager.increment(ALL_NUM);
 | 
			
		||||
                    //  redisClient.increment(ALL_NUM);
 | 
			
		||||
                    allCount++;
 | 
			
		||||
                    completeMap.put(tag, true);
 | 
			
		||||
                    continue;
 | 
			
		||||
                }
 | 
			
		||||
                log.info("开启{}类型的点为起始节点的第{}条数据到第{}条数据反向关系补全", tag, skip, skip + this.limitNum);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user