mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-03 02:52:08 +08:00
v2.1版本更新
This commit is contained in:
@@ -46,4 +46,15 @@ public class TopicCreationConstant {
|
||||
public static final String TOPIC_NAME_PREFIX_RU = "ru01_";
|
||||
|
||||
public static final Integer TOPIC_NAME_MAX_LENGTH = 255;
|
||||
|
||||
|
||||
/**
|
||||
* 单次自动化审批, 默认允许的通过单子
|
||||
*/
|
||||
public static final Integer DEFAULT_MAX_PASSED_ORDER_NUM_PER_TASK = 1;
|
||||
|
||||
/**
|
||||
* 单次自动化审批, 最多允许的通过单子
|
||||
*/
|
||||
public static final Integer MAX_PASSED_ORDER_NUM_PER_TASK = 200;
|
||||
}
|
||||
@@ -86,6 +86,8 @@ public enum ResultStatus {
|
||||
APP_ID_OR_PASSWORD_ILLEGAL(1000, "app or password illegal"),
|
||||
SYSTEM_CODE_ILLEGAL(1000, "system code illegal"),
|
||||
|
||||
CLUSTER_TASK_HOST_LIST_ILLEGAL(1000, "主机列表错误,请检查主机列表"),
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xiaojukeji.kafka.manager.common.entity.ao;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
@@ -23,6 +24,8 @@ public class RdTopicBasic {
|
||||
|
||||
private String description;
|
||||
|
||||
private List<String> regionNameList;
|
||||
|
||||
public Long getClusterId() {
|
||||
return clusterId;
|
||||
}
|
||||
@@ -87,6 +90,14 @@ public class RdTopicBasic {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<String> getRegionNameList() {
|
||||
return regionNameList;
|
||||
}
|
||||
|
||||
public void setRegionNameList(List<String> regionNameList) {
|
||||
this.regionNameList = regionNameList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RdTopicBasic{" +
|
||||
@@ -98,6 +109,7 @@ public class RdTopicBasic {
|
||||
", appName='" + appName + '\'' +
|
||||
", properties=" + properties +
|
||||
", description='" + description + '\'' +
|
||||
", regionNameList='" + regionNameList + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.xiaojukeji.kafka.manager.common.entity.ao.config;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.common.constant.TopicCreationConstant;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -7,8 +10,27 @@ import java.util.List;
|
||||
* @date 20/7/24
|
||||
*/
|
||||
public class CreateTopicConfig {
|
||||
/**
|
||||
* 单次自动化审批, 允许的通过单子
|
||||
*/
|
||||
private Integer maxPassedOrderNumPerTask;
|
||||
|
||||
private List<CreateTopicElemConfig> configList;
|
||||
|
||||
public Integer getMaxPassedOrderNumPerTask() {
|
||||
if (ValidateUtils.isNull(maxPassedOrderNumPerTask)) {
|
||||
return TopicCreationConstant.DEFAULT_MAX_PASSED_ORDER_NUM_PER_TASK;
|
||||
}
|
||||
if (maxPassedOrderNumPerTask > TopicCreationConstant.MAX_PASSED_ORDER_NUM_PER_TASK) {
|
||||
return TopicCreationConstant.MAX_PASSED_ORDER_NUM_PER_TASK;
|
||||
}
|
||||
return maxPassedOrderNumPerTask;
|
||||
}
|
||||
|
||||
public void setMaxPassedOrderNumPerTask(Integer maxPassedOrderNumPerTask) {
|
||||
this.maxPassedOrderNumPerTask = maxPassedOrderNumPerTask;
|
||||
}
|
||||
|
||||
public List<CreateTopicElemConfig> getConfigList() {
|
||||
return configList;
|
||||
}
|
||||
@@ -20,7 +42,8 @@ public class CreateTopicConfig {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CreateTopicConfig{" +
|
||||
"configList=" + configList +
|
||||
"maxPassedOrderNumPerTask=" + maxPassedOrderNumPerTask +
|
||||
", configList=" + configList +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xiaojukeji.kafka.manager.common.entity.ao.topic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author arthur
|
||||
* @date 2018/09/03
|
||||
@@ -17,7 +19,7 @@ public class TopicBasicDTO {
|
||||
|
||||
private String description;
|
||||
|
||||
private String region;
|
||||
private List<String> regionNameList;
|
||||
|
||||
private Integer score;
|
||||
|
||||
@@ -83,12 +85,12 @@ public class TopicBasicDTO {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
public List<String> getRegionNameList() {
|
||||
return regionNameList;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
public void setRegionNameList(List<String> regionNameList) {
|
||||
this.regionNameList = regionNameList;
|
||||
}
|
||||
|
||||
public Integer getScore() {
|
||||
@@ -164,7 +166,7 @@ public class TopicBasicDTO {
|
||||
", principals='" + principals + '\'' +
|
||||
", topicName='" + topicName + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", region='" + region + '\'' +
|
||||
", regionNameList='" + regionNameList + '\'' +
|
||||
", score=" + score +
|
||||
", topicCodeC='" + topicCodeC + '\'' +
|
||||
", partitionNum=" + partitionNum +
|
||||
|
||||
@@ -18,6 +18,8 @@ public class TopicOverview {
|
||||
|
||||
private Object byteIn;
|
||||
|
||||
private Object byteOut;
|
||||
|
||||
private Object produceRequest;
|
||||
|
||||
private String appName;
|
||||
@@ -78,6 +80,14 @@ public class TopicOverview {
|
||||
this.byteIn = byteIn;
|
||||
}
|
||||
|
||||
public Object getByteOut() {
|
||||
return byteOut;
|
||||
}
|
||||
|
||||
public void setByteOut(Object byteOut) {
|
||||
this.byteOut = byteOut;
|
||||
}
|
||||
|
||||
public Object getProduceRequest() {
|
||||
return produceRequest;
|
||||
}
|
||||
@@ -135,6 +145,7 @@ public class TopicOverview {
|
||||
", partitionNum=" + partitionNum +
|
||||
", retentionTime=" + retentionTime +
|
||||
", byteIn=" + byteIn +
|
||||
", byteOut=" + byteOut +
|
||||
", produceRequest=" + produceRequest +
|
||||
", appName='" + appName + '\'' +
|
||||
", appId='" + appId + '\'' +
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.xiaojukeji.kafka.manager.common.entity.dto.rd;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.xiaojukeji.kafka.manager.common.bizenum.ClusterModeEnum;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
@@ -108,10 +109,13 @@ public class LogicalClusterDTO {
|
||||
if (ValidateUtils.isNull(clusterId)
|
||||
|| ValidateUtils.isNull(clusterId)
|
||||
|| ValidateUtils.isEmptyList(regionIdList)
|
||||
|| ValidateUtils.isNull(appId)
|
||||
|| ValidateUtils.isNull(mode)) {
|
||||
return false;
|
||||
}
|
||||
if (!ClusterModeEnum.SHARED_MODE.getCode().equals(mode) && ValidateUtils.isNull(appId)) {
|
||||
return false;
|
||||
}
|
||||
appId = ValidateUtils.isNull(appId)? "": appId;
|
||||
description = ValidateUtils.isNull(description)? "": description;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.xiaojukeji.kafka.manager.common.entity.metrics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zengqiao
|
||||
* @date 20/6/17
|
||||
@@ -11,6 +13,8 @@ public class TopicMetrics extends BaseMetrics {
|
||||
|
||||
private String topicName;
|
||||
|
||||
private List<BrokerMetrics> brokerMetricsList;
|
||||
|
||||
public TopicMetrics(Long clusterId, String topicName) {
|
||||
super();
|
||||
this.clusterId = clusterId;
|
||||
@@ -24,6 +28,14 @@ public class TopicMetrics extends BaseMetrics {
|
||||
this.topicName = topicName;
|
||||
}
|
||||
|
||||
public TopicMetrics(String appId, Long clusterId, String topicName, List<BrokerMetrics> brokerMetricsList) {
|
||||
super();
|
||||
this.appId = appId;
|
||||
this.clusterId = clusterId;
|
||||
this.topicName = topicName;
|
||||
this.brokerMetricsList = brokerMetricsList;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
@@ -36,6 +48,14 @@ public class TopicMetrics extends BaseMetrics {
|
||||
return topicName;
|
||||
}
|
||||
|
||||
public void setBrokerMetricsList(List<BrokerMetrics> brokerMetricsList) {
|
||||
this.brokerMetricsList = brokerMetricsList;
|
||||
}
|
||||
|
||||
public List<BrokerMetrics> getBrokerMetricsList() {
|
||||
return brokerMetricsList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TopicMetrics{" +
|
||||
|
||||
@@ -28,6 +28,9 @@ public class TopicOverviewVO {
|
||||
@ApiModelProperty(value = "每秒流入流量(B)")
|
||||
private Object byteIn;
|
||||
|
||||
@ApiModelProperty(value = "每秒流出流量(B)")
|
||||
private Object byteOut;
|
||||
|
||||
@ApiModelProperty(value = "发送请求数(个/秒)")
|
||||
private Object produceRequest;
|
||||
|
||||
@@ -94,6 +97,14 @@ public class TopicOverviewVO {
|
||||
this.byteIn = byteIn;
|
||||
}
|
||||
|
||||
public Object getByteOut() {
|
||||
return byteOut;
|
||||
}
|
||||
|
||||
public void setByteOut(Object byteOut) {
|
||||
this.byteOut = byteOut;
|
||||
}
|
||||
|
||||
public Object getProduceRequest() {
|
||||
return produceRequest;
|
||||
}
|
||||
@@ -151,6 +162,7 @@ public class TopicOverviewVO {
|
||||
", partitionNum=" + partitionNum +
|
||||
", retentionTime=" + retentionTime +
|
||||
", byteIn=" + byteIn +
|
||||
", byteOut=" + byteOut +
|
||||
", produceRequest=" + produceRequest +
|
||||
", appName='" + appName + '\'' +
|
||||
", appId='" + appId + '\'' +
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.xiaojukeji.kafka.manager.common.entity.vo.normal.topic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Topic的基本信息
|
||||
* @author zengqiao
|
||||
@@ -49,6 +51,9 @@ public class TopicBasicVO {
|
||||
@ApiModelProperty(value = "集群地址")
|
||||
private String bootstrapServers;
|
||||
|
||||
@ApiModelProperty(value = "所属region")
|
||||
private List<String> regionNameList;
|
||||
|
||||
public Long getClusterId() {
|
||||
return clusterId;
|
||||
}
|
||||
@@ -153,6 +158,14 @@ public class TopicBasicVO {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public List<String> getRegionNameList() {
|
||||
return regionNameList;
|
||||
}
|
||||
|
||||
public void setRegionNameList(List<String> regionNameList) {
|
||||
this.regionNameList = regionNameList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TopicBasicVO{" +
|
||||
@@ -169,6 +182,7 @@ public class TopicBasicVO {
|
||||
", topicCodeC='" + topicCodeC + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", bootstrapServers='" + bootstrapServers + '\'' +
|
||||
", regionNameList=" + regionNameList +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.xiaojukeji.kafka.manager.common.entity.vo.normal.topic;
|
||||
|
||||
/**
|
||||
* author: mrazkonglingxu
|
||||
* Date: 2020/12/7
|
||||
* Time: 7:40 下午
|
||||
*/
|
||||
public class TopicBrokerRequestTimeVO {
|
||||
|
||||
private Long clusterId;
|
||||
|
||||
private Integer brokerId;
|
||||
|
||||
private TopicRequestTimeDetailVO brokerRequestTime;
|
||||
|
||||
public Long getClusterId() {
|
||||
return clusterId;
|
||||
}
|
||||
|
||||
public void setClusterId(Long clusterId) {
|
||||
this.clusterId = clusterId;
|
||||
}
|
||||
|
||||
public Integer getBrokerId() {
|
||||
return brokerId;
|
||||
}
|
||||
|
||||
public void setBrokerId(Integer brokerId) {
|
||||
this.brokerId = brokerId;
|
||||
}
|
||||
|
||||
public TopicRequestTimeDetailVO getBrokerRequestTime() {
|
||||
return brokerRequestTime;
|
||||
}
|
||||
|
||||
public void setBrokerRequestTime(TopicRequestTimeDetailVO brokerRequestTime) {
|
||||
this.brokerRequestTime = brokerRequestTime;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package com.xiaojukeji.kafka.manager.common.entity.vo.normal.topic;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zengqiao
|
||||
* @date 20/4/8
|
||||
@@ -33,6 +35,8 @@ public class TopicRequestTimeDetailVO {
|
||||
@ApiModelProperty(value = "totalTimeMs")
|
||||
private Object totalTimeMs;
|
||||
|
||||
private List<TopicBrokerRequestTimeVO> brokerRequestTimeList;
|
||||
|
||||
public String getRequestTimeType() {
|
||||
return requestTimeType;
|
||||
}
|
||||
@@ -97,6 +101,14 @@ public class TopicRequestTimeDetailVO {
|
||||
this.totalTimeMs = totalTimeMs;
|
||||
}
|
||||
|
||||
public List<TopicBrokerRequestTimeVO> getBrokerRequestTimeList() {
|
||||
return brokerRequestTimeList;
|
||||
}
|
||||
|
||||
public void setBrokerRequestTimeList(List<TopicBrokerRequestTimeVO> brokerRequestTimeList) {
|
||||
this.brokerRequestTimeList = brokerRequestTimeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TopicRequestTimeDetailVO{" +
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.xiaojukeji.kafka.manager.common.entity.vo.rd;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
@@ -35,6 +36,9 @@ public class RdTopicBasicVO {
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = "所属region")
|
||||
private List<String> regionNameList;
|
||||
|
||||
public Long getClusterId() {
|
||||
return clusterId;
|
||||
}
|
||||
@@ -99,6 +103,14 @@ public class RdTopicBasicVO {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public List<String> getRegionNameList() {
|
||||
return regionNameList;
|
||||
}
|
||||
|
||||
public void setRegionNameList(List<String> regionNameList) {
|
||||
this.regionNameList = regionNameList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "RdTopicBasicVO{" +
|
||||
@@ -110,6 +122,7 @@ public class RdTopicBasicVO {
|
||||
", appName='" + appName + '\'' +
|
||||
", properties=" + properties +
|
||||
", description='" + description + '\'' +
|
||||
", regionNameList='" + regionNameList + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class JsonUtils {
|
||||
TopicConnectionDO connectionDO = new TopicConnectionDO();
|
||||
|
||||
String[] appIdDetailArray = appIdDetail.toString().split("#");
|
||||
if (appIdDetailArray.length == 3) {
|
||||
if (appIdDetailArray.length >= 3) {
|
||||
connectionDO.setAppId(appIdDetailArray[0]);
|
||||
connectionDO.setIp(appIdDetailArray[1]);
|
||||
connectionDO.setClientVersion(appIdDetailArray[2]);
|
||||
|
||||
@@ -170,7 +170,10 @@ public class MbeanNameUtilV2 {
|
||||
new MbeanV2(
|
||||
"TopicCodeC",
|
||||
JmxAttributeEnum.VALUE_ATTRIBUTE,
|
||||
"kafka.server:type=ReplicaManager,name=TopicCodeC"
|
||||
Arrays.asList(
|
||||
new AbstractMap.SimpleEntry<>(KafkaVersion.VERSION_0_10_3, "kafka.server:type=ReplicaManager,name=TopicCodeC"),
|
||||
new AbstractMap.SimpleEntry<>(KafkaVersion.VERSION_MAX, "kafka.server:type=AppIdTopicMetrics,name=RecordCompression,appId=")
|
||||
)
|
||||
),
|
||||
Arrays.asList(
|
||||
KafkaMetricsCollections.TOPIC_BASIC_PAGE_METRICS
|
||||
|
||||
@@ -8,7 +8,7 @@ package com.xiaojukeji.kafka.manager.common.zookeeper;
|
||||
public class ZkPathUtil {
|
||||
private static final String ZOOKEEPER_SEPARATOR = "/";
|
||||
|
||||
private static final String BROKER_ROOT_NODE = ZOOKEEPER_SEPARATOR + "brokers";
|
||||
public static final String BROKER_ROOT_NODE = ZOOKEEPER_SEPARATOR + "brokers";
|
||||
|
||||
public static final String CONTROLLER_ROOT_NODE = ZOOKEEPER_SEPARATOR + "controller";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user