Migration rule add ip support (#6893)
This commit is contained in:
parent
94ba6e2f8f
commit
530ea1a50a
|
|
@ -56,6 +56,11 @@ public class MigrationRuleHandler<T> {
|
|||
} else {
|
||||
try {
|
||||
rule = MigrationRule.parse(rawRule);
|
||||
// FIXME, consumerURL.getHost() might not exactly the ip expected.
|
||||
if (rule.getTargetIps() == null || !rule.getTargetIps().contains(consumerURL.getHost())) {
|
||||
logger.info("Migration rule ignored, rule target ips " + rule.getTargetIps() + " and local ip " + consumerURL.getHost() + " do not match");
|
||||
return;
|
||||
}
|
||||
setMigrationRule(rule);
|
||||
step = rule.getStep(consumerURL.getServiceKey());
|
||||
threshold = rule.getThreshold(consumerURL.getServiceKey());
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ public class MigrationRule {
|
|||
private String key;
|
||||
private MigrationStep step;
|
||||
private Float threshold;
|
||||
// FIXME
|
||||
private List<String> targetIps;
|
||||
private List<InterfaceMigrationRule> interfaces;
|
||||
|
||||
private transient Map<String, InterfaceMigrationRule> interfaceRules;
|
||||
|
|
@ -100,6 +102,13 @@ public class MigrationRule {
|
|||
return interfaces;
|
||||
}
|
||||
|
||||
public List<String> getTargetIps() {
|
||||
return targetIps;
|
||||
}
|
||||
|
||||
public void setTargetIps(List<String> targetIps) {
|
||||
this.targetIps = targetIps;
|
||||
}
|
||||
|
||||
public void setInterfaces(List<InterfaceMigrationRule> interfaces) {
|
||||
this.interfaces = interfaces;
|
||||
|
|
|
|||
Loading…
Reference in New Issue