扩分区工单优化

This commit is contained in:
zengqiao
2020-07-30 20:56:45 +08:00
parent 33b231d512
commit ba6abea6d8
7 changed files with 52 additions and 3 deletions

View File

@@ -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);

View File

@@ -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<>());