#502 Add NONE healthChecker
This commit is contained in:
parent
7bf60c18e7
commit
592f2b4301
@ -47,6 +47,20 @@ public abstract class AbstractHealthChecker implements Cloneable {
|
|||||||
*/
|
*/
|
||||||
public abstract AbstractHealthChecker clone() throws CloneNotSupportedException;
|
public abstract AbstractHealthChecker clone() throws CloneNotSupportedException;
|
||||||
|
|
||||||
|
public static class None extends AbstractHealthChecker {
|
||||||
|
|
||||||
|
public static final String TYPE = "NONE";
|
||||||
|
|
||||||
|
public None() {
|
||||||
|
this.setType(TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AbstractHealthChecker clone() throws CloneNotSupportedException {
|
||||||
|
return new None();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class Http extends AbstractHealthChecker {
|
public static class Http extends AbstractHealthChecker {
|
||||||
public static final String TYPE = "HTTP";
|
public static final String TYPE = "HTTP";
|
||||||
|
|
||||||
|
@ -87,6 +87,9 @@ public class ClusterController {
|
|||||||
case AbstractHealthChecker.Mysql.TYPE:
|
case AbstractHealthChecker.Mysql.TYPE:
|
||||||
abstractHealthChecker = JSON.parseObject(healthChecker, AbstractHealthChecker.Mysql.class);
|
abstractHealthChecker = JSON.parseObject(healthChecker, AbstractHealthChecker.Mysql.class);
|
||||||
break;
|
break;
|
||||||
|
case AbstractHealthChecker.None.TYPE:
|
||||||
|
abstractHealthChecker = JSON.parseObject(healthChecker, AbstractHealthChecker.None.class);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new NacosException(NacosException.INVALID_PARAM, "unknown health check type:" + healthChecker);
|
throw new NacosException(NacosException.INVALID_PARAM, "unknown health check type:" + healthChecker);
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,8 @@ public class Instance extends com.alibaba.nacos.api.naming.pojo.Instance impleme
|
|||||||
Instance other = (Instance) obj;
|
Instance other = (Instance) obj;
|
||||||
|
|
||||||
// 0 means wild
|
// 0 means wild
|
||||||
return getIp().equals(other.getIp()) && (getPort() == other.getPort() || getPort() == 0);
|
return getIp().equals(other.getIp()) && (getPort() == other.getPort() || getPort() == 0)
|
||||||
|
&& this.isEphemeral() == other.isEphemeral();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JSONField(serialize = false)
|
@JSONField(serialize = false)
|
||||||
|
Loading…
Reference in New Issue
Block a user