增加分区

This commit is contained in:
许晓东
2021-10-18 20:53:25 +08:00
parent f18e857d3c
commit 0f4663d58f
8 changed files with 234 additions and 4 deletions

View File

@@ -0,0 +1,21 @@
package com.xuxd.kafka.console.beans.dto;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
/**
* kafka-console-ui.
*
* @author xuxd
* @date 2021-10-18 19:55:40
**/
@Data
public class AddPartitionDTO {
private String topic;
private int addNum;
private List<List<Integer>> assignment = new ArrayList<>();
}

View File

@@ -21,7 +21,7 @@ public class NewTopicDTO {
private Map<String, String> configs = new HashMap<>();
public NewTopic toNewTopic() {
NewTopic topic = new NewTopic(name, numPartitions, replicationFactor);
NewTopic topic = new NewTopic(name.trim(), numPartitions, replicationFactor);
if (MapUtils.isNotEmpty(configs)) {
topic.configs(configs);
}