summaryrefslogtreecommitdiffstats
path: root/rulemgt/src/main
diff options
context:
space:
mode:
authorGuangrong Fu <fu.guangrong@zte.com.cn>2021-08-25 16:19:55 +0800
committerGuangrong Fu <fu.guangrong@zte.com.cn>2021-08-25 16:19:55 +0800
commit29a4ea55b65acbf90b3904fe6143793f29f4fcb3 (patch)
tree0e9d85a14334c5c69254d00e7fc55df06068ab8b /rulemgt/src/main
parentedc531673b23dd854e16ff6f52d749ceb93b1548 (diff)
added some comments for better comprehension9.0.0
Issue-ID: HOLMES-462 Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn> Change-Id: Iccbf52d01489607370a03e86e94676f942cc65a2
Diffstat (limited to 'rulemgt/src/main')
-rw-r--r--rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAllocator.java9
1 files changed, 5 insertions, 4 deletions
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 31c200a..bf26b71 100644
--- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAllocator.java
+++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/RuleAllocator.java
@@ -90,15 +90,16 @@ public class RuleAllocator {
return;
}
- if (legacyEngineInstances.size() < numOfEngines) {
- //extend
+ if (legacyEngineInstances.size() < numOfEngines) { // extend
List<CorrelationRule> rules2Allocate = calculateRule(legacyEngineInstances, numOfEngines);
List<CorrelationRule> rules2Delete = copyList(rules2Allocate);
List<String> newInstanceIds = sortOutNewEngineInstances(engines, legacyEngineInstances);
distributeRules(newInstanceIds, rules2Allocate);
cleanUpRulesFromEngines(rules2Delete, legacyEngineInstances);
- } else {
- //destroy
+ } else { // destroy
+ // If new engine instances share the same IP addresses with the old ones, the
+ // rule management module will simply leave the them to cope with the legacy rules.
+ // Here, it only takes care of the rules that need to be moved from one IP address to another.
List<String> destroyed = getDestroyedEngines(engines, legacyEngineInstances);
distributeRules(getRemainingEngines(engines, destroyed), getRules(destroyed));
}