优化代码
This commit is contained in:
parent
af422289d8
commit
16f448ba91
15
config/application-4.yaml
Normal file
15
config/application-4.yaml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
nebula:
|
||||
userName: root
|
||||
password: nebula
|
||||
hostAddresses: 192.168.7.32:9669,192.168.7.153:9669
|
||||
minConnsSize: 20
|
||||
maxConnSize: 50
|
||||
timeout: 600000
|
||||
idleTime: 180000
|
||||
spaceName: Y24_1206
|
||||
limitNum: 100 #
|
||||
|
||||
#redis:
|
||||
# host: 192.168.7.32
|
||||
# port: 6379
|
||||
# password: 123456
|
||||
|
|
@ -69,28 +69,28 @@ public class RelationCompletion {
|
|||
boolean isComplete = false;
|
||||
Map<String, Boolean> completeMap = new HashMap();
|
||||
while (true) {
|
||||
completeMap.forEach((k, v) -> {
|
||||
if (v) {
|
||||
allCount.getAndIncrement();
|
||||
}
|
||||
});
|
||||
if (allCount.get() == 5) {
|
||||
log.info("关系补全全部结束...");
|
||||
break;
|
||||
}
|
||||
// completeMap.forEach((k, v) -> {
|
||||
// if (v) {
|
||||
// allCount.getAndIncrement();
|
||||
// }
|
||||
// });
|
||||
// if (allCount.get() == 5) {
|
||||
// log.info("关系补全全部结束...");
|
||||
// break;
|
||||
// }
|
||||
for (TagEnum tagEnum : TagEnum.values()) {
|
||||
Object allGetNum = FileCacheManager.get(ALL_NUM, Integer.class);
|
||||
if (allGetNum != null && (Integer) allGetNum >= 5) {
|
||||
isComplete = true;
|
||||
break;
|
||||
}
|
||||
// if (allGetNum != null && (Integer) allGetNum >= 5) {
|
||||
// isComplete = true;
|
||||
// break;
|
||||
// }
|
||||
|
||||
String tag = tagEnum.getTag();
|
||||
Integer num = FileCacheManager.get(tag + "_num", Integer.class);
|
||||
// Object num = redisClient.get(tag + "_num");
|
||||
Integer skip = (num == null ? 0 : num);
|
||||
if (tagNumsMap.get(tag) < skip) {
|
||||
FileCacheManager.increment(ALL_NUM);
|
||||
// FileCacheManager.increment(ALL_NUM);
|
||||
// redisClient.increment(ALL_NUM);
|
||||
completeMap.put(tag, true);
|
||||
continue;
|
||||
|
|
@ -102,13 +102,13 @@ public class RelationCompletion {
|
|||
NebulaMultiMatchJsonResult.class);
|
||||
|
||||
if (CollectionUtils.isEmpty(idJsonResults)) {
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
List<String> idLists = NebulaMultiMatchJsonResult.getIdLists(idJsonResults.get(0));
|
||||
if (CollectionUtils.isEmpty(idLists)) {
|
||||
log.info("idLists为空...");
|
||||
break;
|
||||
continue;
|
||||
} else {
|
||||
log.info("查询到的idLists大小: {}", idLists.size());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
nebula:
|
||||
userName: root
|
||||
password: nebula
|
||||
hostAddresses: 192.168.7.32:9669,192.168.7.153:9669
|
||||
minConnsSize: 20
|
||||
maxConnSize: 50
|
||||
hostAddresses: 172.16.20.2:9669,172.16.20.4:9669,172.16.20.5:9669
|
||||
minConnsSize: 10
|
||||
maxConnSize: 30
|
||||
timeout: 600000
|
||||
idleTime: 180000
|
||||
spaceName: Y24_1206
|
||||
limitNum: 2000 #
|
||||
spaceName: Y0210_TEST
|
||||
limitNum: 500 #
|
||||
|
||||
redis:
|
||||
host: 192.168.7.32
|
||||
port: 6379
|
||||
password: 123456
|
||||
#redis:
|
||||
# host: 172.16.20.1
|
||||
# port: 6379
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
nebula:
|
||||
userName: root
|
||||
password: nebula
|
||||
hostAddresses: 172.16.20.2:9669,172.16.20.4:9669,172.16.20.5:9669
|
||||
minConnsSize: 10
|
||||
hostAddresses: 192.168.7.32:9669,192.168.7.153:9669
|
||||
minConnsSize: 20
|
||||
maxConnSize: 30
|
||||
timeout: 600000
|
||||
idleTime: 180000
|
||||
|
|
@ -10,5 +10,6 @@ nebula:
|
|||
limitNum: 500 #
|
||||
|
||||
#redis:
|
||||
# host: 172.16.20.1
|
||||
# port: 6379
|
||||
# host: 192.168.7.32
|
||||
# port: 6379
|
||||
# password: 123456
|
||||
Loading…
Reference in New Issue
Block a user