X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=rulemgt%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Frulemgt%2FRuleAllocator.java;fp=rulemgt%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Frulemgt%2FRuleAllocator.java;h=31c200a997a50b5128a3f25b638b5051afdf8f49;hb=bd657ac5ef55d89917f42b76b1cee9c9852a07a8;hp=2dc05ee1a9c7b041d6503fa6a24fa9799f59f190;hpb=6c0d57eeaa87ac1d2a4a808a93963a5c3c78d68a;p=holmes%2Frule-management.git diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAllocator.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAllocator.java index 2dc05ee..31c200a 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAllocator.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAllocator.java @@ -1,5 +1,5 @@ /** - * Copyright 2017-2020 ZTE Corporation. + * Copyright 2017-2021 ZTE Corporation. *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import java.util.*;
+import java.util.concurrent.TimeUnit;
import static java.util.concurrent.TimeUnit.SECONDS;
@@ -41,6 +42,8 @@ public class RuleAllocator {
private static final Logger LOGGER = LoggerFactory.getLogger(RuleAllocator.class);
public final static int ENABLE = 1;
+ public final static int RETRY_TIMES = 5;
+ public final static long RETRY_INTERVAL_SEC = 15;
private RuleMgtWrapper ruleMgtWrapper;
private RuleQueryWrapper ruleQueryWrapper;
private EngineWrapper engineWrapper;
@@ -194,7 +197,7 @@ public class RuleAllocator {
// Sorted by the number of rules each engine contains, in a descending order.
private List