mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 11:52:08 +08:00
@@ -9,6 +9,10 @@ public class OrderPartitionDO extends BaseDO{
|
||||
|
||||
private String applicant;
|
||||
|
||||
private Integer partitionNum;
|
||||
|
||||
private String brokerList;
|
||||
|
||||
private Long peakBytesIn;
|
||||
|
||||
private String description;
|
||||
@@ -51,6 +55,22 @@ public class OrderPartitionDO extends BaseDO{
|
||||
this.applicant = applicant;
|
||||
}
|
||||
|
||||
public Integer getPartitionNum() {
|
||||
return partitionNum;
|
||||
}
|
||||
|
||||
public void setPartitionNum(Integer partitionNum) {
|
||||
this.partitionNum = partitionNum;
|
||||
}
|
||||
|
||||
public String getBrokerList() {
|
||||
return brokerList;
|
||||
}
|
||||
|
||||
public void setBrokerList(String brokerList) {
|
||||
this.brokerList = brokerList;
|
||||
}
|
||||
|
||||
public Long getPeakBytesIn() {
|
||||
return peakBytesIn;
|
||||
}
|
||||
@@ -98,6 +118,8 @@ public class OrderPartitionDO extends BaseDO{
|
||||
", clusterName='" + clusterName + '\'' +
|
||||
", topicName='" + topicName + '\'' +
|
||||
", applicant='" + applicant + '\'' +
|
||||
", partitionNum=" + partitionNum +
|
||||
", brokerList='" + brokerList + '\'' +
|
||||
", peakBytesIn=" + peakBytesIn +
|
||||
", description='" + description + '\'' +
|
||||
", orderStatus=" + orderStatus +
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
<result column="cluster_name" property="clusterName" />
|
||||
<result column="topic_name" property="topicName" />
|
||||
<result column="applicant" property="applicant" />
|
||||
<result column="partition_num" property="partitionNum" />
|
||||
<result column="broker_list" property="brokerList" />
|
||||
<result column="peak_bytes_in" property="peakBytesIn" />
|
||||
<result column="description" property="description" />
|
||||
<result column="order_status" property="orderStatus" />
|
||||
@@ -38,6 +40,16 @@
|
||||
cluster_name=#{clusterName},
|
||||
topic_name=#{topicName},
|
||||
applicant=#{applicant},
|
||||
<trim>
|
||||
<if test="partitionNum!=null">
|
||||
partition_num=#{partitionNum},
|
||||
</if>
|
||||
</trim>
|
||||
<trim>
|
||||
<if test="brokerList!=null">
|
||||
broker_list=#{brokerList},
|
||||
</if>
|
||||
</trim>
|
||||
peak_bytes_in=#{peakBytesIn},
|
||||
description=#{description},
|
||||
order_status=#{orderStatus},
|
||||
|
||||
@@ -149,6 +149,8 @@ CREATE TABLE `order_partition` (
|
||||
`cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
|
||||
`cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
|
||||
`topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
|
||||
`broker_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'Broker列表, 逗号分割',
|
||||
`partition_num` int(11) NOT NULL DEFAULT 0 COMMENT '新增分区数',
|
||||
`applicant` varchar(128) NOT NULL DEFAULT '' COMMENT '申请人',
|
||||
`peak_bytes_in` bigint(20) NOT NULL DEFAULT '0' COMMENT '峰值流量',
|
||||
`description` text COMMENT '备注信息',
|
||||
|
||||
@@ -198,6 +198,8 @@ CREATE TABLE order_partition
|
||||
cluster_name varchar(128) NOT NULL DEFAULT '', -- '集群名称',
|
||||
topic_name varchar(192) NOT NULL DEFAULT '', -- 'Topic名称',
|
||||
applicant varchar(128) NOT NULL DEFAULT '', -- '申请人',
|
||||
partition_num int NOT NULL DEFAULT '0', -- '分区数',
|
||||
broker_list varchar(128) NOT NULL DEFAULT '', -- 'Broker列表',
|
||||
peak_bytes_in bigint NOT NULL DEFAULT '0', -- '峰值流量',
|
||||
description text, -- '备注信息',
|
||||
order_status int NOT NULL DEFAULT '0', -- '工单状态',
|
||||
|
||||
@@ -149,6 +149,8 @@ CREATE TABLE `order_partition` (
|
||||
`cluster_id` bigint(20) NOT NULL DEFAULT '-1' COMMENT '集群ID',
|
||||
`cluster_name` varchar(128) NOT NULL DEFAULT '' COMMENT '集群名称',
|
||||
`topic_name` varchar(192) NOT NULL DEFAULT '' COMMENT 'Topic名称',
|
||||
`broker_list` varchar(256) NOT NULL DEFAULT '' COMMENT 'Broker列表, 逗号分割',
|
||||
`partition_num` int(11) NOT NULL DEFAULT 0 COMMENT '新增分区数',
|
||||
`applicant` varchar(128) NOT NULL DEFAULT '' COMMENT '申请人',
|
||||
`peak_bytes_in` bigint(20) NOT NULL DEFAULT '0' COMMENT '峰值流量',
|
||||
`description` text COMMENT '备注信息',
|
||||
|
||||
@@ -332,7 +332,9 @@ public class OrderController {
|
||||
return new Result();
|
||||
}
|
||||
|
||||
private Result expandTopic(ClusterDO clusterDO, OrderPartitionExecModel reqObj, OrderPartitionDO orderPartitionDO) {
|
||||
private Result expandTopic(ClusterDO clusterDO,
|
||||
OrderPartitionExecModel reqObj,
|
||||
OrderPartitionDO orderPartitionDO) {
|
||||
List<Integer> brokerIdList = regionService.getFullBrokerId(clusterDO.getId(), reqObj.getRegionIdList(), reqObj.getBrokerIdList());
|
||||
try {
|
||||
TopicMetadata topicMetadata = new TopicMetadata();
|
||||
@@ -343,6 +345,8 @@ public class OrderController {
|
||||
if (!AdminTopicStatusEnum.SUCCESS.equals(adminTopicStatusEnum)) {
|
||||
return new Result(StatusCode.OPERATION_ERROR, adminTopicStatusEnum.getMessage());
|
||||
}
|
||||
orderPartitionDO.setPartitionNum(reqObj.getPartitionNum());
|
||||
orderPartitionDO.setBrokerList(ListUtils.intList2String(brokerIdList));
|
||||
} catch (Exception e) {
|
||||
logger.error("expandTopic@OrderController, create failed, req:{}.", reqObj);
|
||||
return new Result(StatusCode.OPERATION_ERROR, Constant.KAFKA_MANAGER_INNER_ERROR);
|
||||
|
||||
@@ -86,7 +86,8 @@ public class OrderConverter {
|
||||
|
||||
public static OrderPartitionVO convert2OrderPartitionVO(OrderPartitionDO orderPartitionDO,
|
||||
TopicMetadata topicMetadata,
|
||||
Long maxAvgBytes, List<RegionDO> regionDOList) {
|
||||
Long maxAvgBytes,
|
||||
List<RegionDO> regionDOList) {
|
||||
if (orderPartitionDO == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -100,8 +101,12 @@ public class OrderConverter {
|
||||
if (topicMetadata == null) {
|
||||
return orderPartitionVO;
|
||||
}
|
||||
orderPartitionVO.setPartitionNum(topicMetadata.getPartitionNum());
|
||||
|
||||
orderPartitionVO.setPartitionNum(null);
|
||||
orderPartitionVO.setBrokerIdList(new ArrayList<>(topicMetadata.getBrokerIdSet()));
|
||||
if (OrderStatusEnum.PASSED.getCode().equals(orderPartitionDO.getOrderStatus())) {
|
||||
orderPartitionVO.setPartitionNum(orderPartitionDO.getPartitionNum());
|
||||
}
|
||||
|
||||
if (regionDOList == null || regionDOList.isEmpty()) {
|
||||
orderPartitionVO.setRegionNameList(new ArrayList<>());
|
||||
|
||||
Reference in New Issue
Block a user