Unverified Commit 4cfd123d authored by Zzm0809's avatar Zzm0809 Committed by GitHub

[Fix] Fix the issue of cluster instances being unable to be deleted (#3521)

Signed-off-by: 's avatarZzm0809 <934230207@qq.com>
parent 48f7e9cb
......@@ -96,7 +96,7 @@ public class ClusterInstance extends SuperEntity<ClusterInstance> {
dataType = "Boolean",
example = "test",
notes = "is auto registers, if this record from projob/application mode , it will be true")
private Boolean autoRegisters;
private boolean autoRegisters;
@ApiModelProperty(
value = "clusterConfigurationId",
......
......@@ -98,7 +98,7 @@ public class ClearJobHistoryHandler {
clusterDeleteWrapper
.lambda()
.in(true, ClusterInstance::getId, clusterDeleteIds)
.eq(ClusterInstance::getAutoRegisters, true);
.eq(ClusterInstance::isAutoRegisters, true);
clusterService.remove(clusterDeleteWrapper);
}
}
......
......@@ -178,7 +178,7 @@ public class ClusterInstanceServiceImpl extends SuperServiceImpl<ClusterInstance
ClusterInstance clusterInstance = getById(id);
// if cluster instance is not null and cluster instance is health, can not delete, must kill cluster instance
// first
if (Asserts.isNotNull(clusterInstance) && checkHealth(clusterInstance)) {
if (Asserts.isNotNull(clusterInstance) && checkHealth(clusterInstance) && clusterInstance.isAutoRegisters()) {
throw new BusException(Status.CLUSTER_INSTANCE_HEALTH_NOT_DELETE);
}
return removeById(id);
......@@ -258,7 +258,7 @@ public class ClusterInstanceServiceImpl extends SuperServiceImpl<ClusterInstance
public List<ClusterInstance> selectListByKeyWord(String searchKeyWord, boolean isAutoCreate) {
return getBaseMapper()
.selectList(new LambdaQueryWrapper<ClusterInstance>()
.and(true, i -> i.eq(ClusterInstance::getAutoRegisters, isAutoCreate))
.and(true, i -> i.eq(ClusterInstance::isAutoRegisters, isAutoCreate))
.and(true, i -> i.like(ClusterInstance::getName, searchKeyWord)
.or()
.like(ClusterInstance::getAlias, searchKeyWord)
......
......@@ -144,7 +144,7 @@ cluster.not.exist=Cluster Not Exist
cluster.instance.exist.relationship=Cluster Instance Already Exists Relationship, Can Not Delete
cluster.instance.local.not.support.kill=Local Mode Cluster Instance Not Support Kill
cluster.instance.not.health=Cluster Instance Status Not Health
cluster.instance.health.not.delete=Cluster Instance Status Health, Can Not Delete, Please Stop Cluster Instance First
cluster.instance.health.not.delete=This cluster instance belongs to automatic registration mode and is in an available state, and deletion is not allowed. Please stop this cluster instance first
cluster.config.exist.relationship=Cluster Config Already Exists Relationship, Can Not Delete
udf.template.exist.relationship=Udf Template Already Exists Relationship, Can Not Delete
operate.failed=Operate Failed
......
......@@ -144,7 +144,7 @@ cluster.not.exist=集群不存在
cluster.instance.exist.relationship=集群实例已存在关联关系,不允许删除
cluster.instance.local.not.support.kill=Local 模式集群实例暂未实现停止功能
cluster.instance.not.health=集群实例状态不健康
cluster.instance.health.not.delete=集群实例为可用状态,不允许删除,请先停止该集群实例
cluster.instance.health.not.delete=该集群实例属于自动注册模式且为可用状态,不允许删除,请先停止该集群实例
cluster.config.exist.relationship=集群配置已存在关联关系,不允许删除
udf.template.exist.relationship=UDF模板已存在关联关系,不允许删除
operate.failed=操作失败
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment