|
|
@ -18,6 +18,7 @@
|
|
|
|
package com.tencent.cloud.polaris;
|
|
|
|
package com.tencent.cloud.polaris;
|
|
|
|
|
|
|
|
|
|
|
|
import com.tencent.cloud.common.constant.ContextConstant;
|
|
|
|
import com.tencent.cloud.common.constant.ContextConstant;
|
|
|
|
|
|
|
|
import com.tencent.polaris.api.config.consumer.OutlierDetectionConfig;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
|
@ -122,6 +123,11 @@ public class PolarisDiscoveryProperties {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private Boolean allRecoverEnabled = true;
|
|
|
|
private Boolean allRecoverEnabled = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Instance detect.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private Detect detect = new Detect();
|
|
|
|
|
|
|
|
|
|
|
|
public String getInstanceId() {
|
|
|
|
public String getInstanceId() {
|
|
|
|
return instanceId;
|
|
|
|
return instanceId;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -265,6 +271,14 @@ public class PolarisDiscoveryProperties {
|
|
|
|
this.registerEnabled = registerEnabled;
|
|
|
|
this.registerEnabled = registerEnabled;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Detect getDetect() {
|
|
|
|
|
|
|
|
return detect;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setDetect(Detect detect) {
|
|
|
|
|
|
|
|
this.detect = detect;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
public String toString() {
|
|
|
|
return "PolarisDiscoveryProperties{" +
|
|
|
|
return "PolarisDiscoveryProperties{" +
|
|
|
@ -284,6 +298,29 @@ public class PolarisDiscoveryProperties {
|
|
|
|
", zeroProtectionNeedTestConnectivity=" + zeroProtectionNeedTestConnectivity +
|
|
|
|
", zeroProtectionNeedTestConnectivity=" + zeroProtectionNeedTestConnectivity +
|
|
|
|
", preferIpv6=" + preferIpv6 +
|
|
|
|
", preferIpv6=" + preferIpv6 +
|
|
|
|
", allRecoverEnabled=" + allRecoverEnabled +
|
|
|
|
", allRecoverEnabled=" + allRecoverEnabled +
|
|
|
|
|
|
|
|
", detect=" + detect +
|
|
|
|
'}';
|
|
|
|
'}';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class Detect {
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Enable instance detect or not.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private OutlierDetectionConfig.When when = OutlierDetectionConfig.When.never;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public OutlierDetectionConfig.When getWhen() {
|
|
|
|
|
|
|
|
return when;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setWhen(OutlierDetectionConfig.When when) {
|
|
|
|
|
|
|
|
this.when = when;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
|
|
|
|
return "Detect{" +
|
|
|
|
|
|
|
|
"when=" + when +
|
|
|
|
|
|
|
|
'}';
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|