Skip to content

Commit

Permalink
[Fix] Fix the issue of cluster instances being unable to be deleted (D…
Browse files Browse the repository at this point in the history
…ataLinkDC#3521)

Signed-off-by: Zzm0809 <934230207@qq.com>
  • Loading branch information
Zzm0809 authored May 23, 2024
1 parent 48f7e9c commit 4cfd123
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void clearJobHistory(Integer maxRetainDays, Integer maxRetainCount) {
clusterDeleteWrapper
.lambda()
.in(true, ClusterInstance::getId, clusterDeleteIds)
.eq(ClusterInstance::getAutoRegisters, true);
.eq(ClusterInstance::isAutoRegisters, true);
clusterService.remove(clusterDeleteWrapper);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public Boolean deleteClusterInstanceById(Integer id) {
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);
Expand Down Expand Up @@ -258,7 +258,7 @@ public ClusterInstance deploySessionCluster(Integer id) {
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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=操作失败
Expand Down

0 comments on commit 4cfd123

Please sign in to comment.