mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 03:42:07 +08:00
[Feature]新增删除Group或GroupOffset功能 (#1064)
不包括前端,后端新增 1、新增Group删除功能; 2、新增Group-Topic纬度Offset删除功能; 3、新增Group-Topic-Partition纬度Offset删除功能;
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.xiaojukeji.know.streaming.km.common.bean.dto.group;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.xiaojukeji.know.streaming.km.common.bean.dto.BaseDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 删除offset
|
||||
* @author zengqiao
|
||||
* @date 19/4/8
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class GroupOffsetDeleteDTO extends BaseDTO {
|
||||
@Min(value = 0, message = "clusterPhyId不允许为null或者小于0")
|
||||
@ApiModelProperty(value = "集群ID", example = "6")
|
||||
private Long clusterPhyId;
|
||||
|
||||
@NotBlank(message = "groupName不允许为空")
|
||||
@ApiModelProperty(value = "消费组名称", example = "g-know-streaming")
|
||||
private String groupName;
|
||||
|
||||
@ApiModelProperty(value = "Topic名称,按照Topic纬度进行删除时需要传", example = "know-streaming")
|
||||
protected String topicName;
|
||||
|
||||
@ApiModelProperty(value = "分区ID,按照分区纬度进行删除时需要传")
|
||||
private Integer partitionId;
|
||||
|
||||
/**
|
||||
* @see com.xiaojukeji.know.streaming.km.common.enums.group.DeleteGroupTypeEnum
|
||||
*/
|
||||
@NotNull(message = "deleteType不允许为空")
|
||||
@ApiModelProperty(value = "删除类型", example = "0:group纬度,1:Topic纬度,2:Partition纬度")
|
||||
private Integer deleteType;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xiaojukeji.know.streaming.km.common.bean.entity.param.group;
|
||||
|
||||
import com.xiaojukeji.know.streaming.km.common.enums.group.DeleteGroupTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class DeleteGroupParam extends GroupParam {
|
||||
protected DeleteGroupTypeEnum deleteGroupTypeEnum;
|
||||
|
||||
public DeleteGroupParam(Long clusterPhyId, String groupName, DeleteGroupTypeEnum deleteGroupTypeEnum) {
|
||||
super(clusterPhyId, groupName);
|
||||
this.deleteGroupTypeEnum = deleteGroupTypeEnum;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xiaojukeji.know.streaming.km.common.bean.entity.param.group;
|
||||
|
||||
import com.xiaojukeji.know.streaming.km.common.enums.group.DeleteGroupTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class DeleteGroupTopicParam extends DeleteGroupParam {
|
||||
protected String topicName;
|
||||
|
||||
public DeleteGroupTopicParam(Long clusterPhyId, String groupName, DeleteGroupTypeEnum deleteGroupTypeEnum, String topicName) {
|
||||
super(clusterPhyId, groupName, deleteGroupTypeEnum);
|
||||
this.topicName = topicName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.xiaojukeji.know.streaming.km.common.bean.entity.param.group;
|
||||
|
||||
import com.xiaojukeji.know.streaming.km.common.enums.group.DeleteGroupTypeEnum;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class DeleteGroupTopicPartitionParam extends DeleteGroupTopicParam {
|
||||
protected Integer partitionId;
|
||||
|
||||
public DeleteGroupTopicPartitionParam(Long clusterPhyId, String groupName, DeleteGroupTypeEnum deleteGroupTypeEnum, String topicName, Integer partitionId) {
|
||||
super(clusterPhyId, groupName, deleteGroupTypeEnum, topicName);
|
||||
this.partitionId = partitionId;
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,11 @@
|
||||
package com.xiaojukeji.know.streaming.km.common.bean.entity.param.group;
|
||||
|
||||
import com.xiaojukeji.know.streaming.km.common.bean.entity.param.cluster.ClusterPhyParam;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class GroupParam extends ClusterPhyParam {
|
||||
protected String groupName;
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.xiaojukeji.know.streaming.km.common.enums.group;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
|
||||
/**
|
||||
* @author wyb
|
||||
* @date 2022/10/11
|
||||
*/
|
||||
@Getter
|
||||
public enum DeleteGroupTypeEnum {
|
||||
UNKNOWN(-1, "Unknown"),
|
||||
|
||||
GROUP(0, "Group纬度"),
|
||||
|
||||
GROUP_TOPIC(1, "GroupTopic纬度"),
|
||||
|
||||
GROUP_TOPIC_PARTITION(2, "GroupTopicPartition纬度");
|
||||
|
||||
private final Integer code;
|
||||
|
||||
private final String msg;
|
||||
|
||||
DeleteGroupTypeEnum(Integer code, String msg) {
|
||||
this.code = code;
|
||||
this.msg = msg;
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,8 @@ public enum VersionItemTypeEnum {
|
||||
|
||||
SERVICE_OP_REASSIGNMENT(330, "service_reassign_operation"),
|
||||
|
||||
SERVICE_OP_GROUP(340, "service_group_operation"),
|
||||
|
||||
SERVICE_OP_CONNECT_CLUSTER(400, "service_connect_cluster_operation"),
|
||||
SERVICE_OP_CONNECT_CONNECTOR(401, "service_connect_connector_operation"),
|
||||
SERVICE_OP_CONNECT_PLUGIN(402, "service_connect_plugin_operation"),
|
||||
|
||||
Reference in New Issue
Block a user