mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 20:22:12 +08:00
扩分区工单优化
This commit is contained in:
@@ -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