mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-08 15:52:15 +08:00
v2.4.0 be code
This commit is contained in:
@@ -17,5 +17,5 @@ public interface OperateRecordService {
|
||||
|
||||
int insert(String operator, ModuleEnum module, String resourceName, OperateEnum operate, Map<String, String> content);
|
||||
|
||||
List<OperateRecordDO> queryByCondt(OperateRecordDTO dto);
|
||||
List<OperateRecordDO> queryByCondition(OperateRecordDTO dto);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,15 @@ public interface TopicManagerService {
|
||||
|
||||
Map<String, List<Double>> getTopicMaxAvgBytesIn(Long clusterId, Integer latestDay, Double minMaxAvgBytesIn);
|
||||
|
||||
/**
|
||||
* 获取指定时间范围内Topic的峰值均值流量
|
||||
* @param clusterId 集群ID
|
||||
* @param topicName Topic名称
|
||||
* @param startTime 开始时间
|
||||
* @param endTime 结束时间
|
||||
* @param maxAvgDay 最大几天的均值
|
||||
* @return
|
||||
*/
|
||||
Double getTopicMaxAvgBytesIn(Long clusterId, String topicName, Date startTime, Date endTime, Integer maxAvgDay);
|
||||
|
||||
TopicStatisticsDO getByTopicAndDay(Long clusterId, String topicName, String gmtDay);
|
||||
|
||||
@@ -66,7 +66,10 @@ public class AdminServiceImpl implements AdminService {
|
||||
String applicant,
|
||||
String operator) {
|
||||
List<Integer> fullBrokerIdList = regionService.getFullBrokerIdList(clusterDO.getId(), regionId, brokerIdList);
|
||||
if (PhysicalClusterMetadataManager.getNotAliveBrokerNum(clusterDO.getId(), fullBrokerIdList) > DEFAULT_DEAD_BROKER_LIMIT_NUM) {
|
||||
|
||||
Long notAliveBrokerNum = PhysicalClusterMetadataManager.getNotAliveBrokerNum(clusterDO.getId(), fullBrokerIdList);
|
||||
if (notAliveBrokerNum >= fullBrokerIdList.size() || notAliveBrokerNum > DEFAULT_DEAD_BROKER_LIMIT_NUM) {
|
||||
// broker全挂了,或者是挂的数量大于了DEFAULT_DEAD_BROKER_LIMIT_NUM时, 则认为broker参数不合法
|
||||
return ResultStatus.BROKER_NOT_EXIST;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,7 @@ public class ClusterServiceImpl implements ClusterService {
|
||||
content.put("security properties", clusterDO.getSecurityProperties());
|
||||
content.put("jmx properties", clusterDO.getJmxProperties());
|
||||
operateRecordService.insert(operator, ModuleEnum.CLUSTER, clusterDO.getClusterName(), OperateEnum.ADD, content);
|
||||
|
||||
if (clusterDao.insert(clusterDO) <= 0) {
|
||||
LOGGER.error("add new cluster failed, clusterDO:{}.", clusterDO);
|
||||
return ResultStatus.MYSQL_ERROR;
|
||||
|
||||
@@ -41,8 +41,8 @@ public class OperateRecordServiceImpl implements OperateRecordService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OperateRecordDO> queryByCondt(OperateRecordDTO dto) {
|
||||
return operateRecordDao.queryByCondt(
|
||||
public List<OperateRecordDO> queryByCondition(OperateRecordDTO dto) {
|
||||
return operateRecordDao.queryByCondition(
|
||||
dto.getModuleId(),
|
||||
dto.getOperateId(),
|
||||
dto.getOperator(),
|
||||
|
||||
@@ -147,12 +147,14 @@ public class TopicManagerServiceImpl implements TopicManagerService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Double getTopicMaxAvgBytesIn(Long clusterId,
|
||||
String topicName,
|
||||
Date startTime,
|
||||
Date endTime,
|
||||
Integer maxAvgDay) {
|
||||
return topicStatisticsDao.getTopicMaxAvgBytesIn(clusterId, topicName, startTime, endTime, maxAvgDay);
|
||||
public Double getTopicMaxAvgBytesIn(Long clusterId, String topicName, Date startTime, Date endTime, Integer maxAvgDay) {
|
||||
try {
|
||||
return topicStatisticsDao.getTopicMaxAvgBytesIn(clusterId, topicName, startTime, endTime, maxAvgDay);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("class=TopicManagerServiceImpl||method=getTopicMaxAvgBytesIn||clusterId={}||topicName={}||startTime={}||endTime={}||maxAvgDay={}||errMsg={}",
|
||||
clusterId, topicName, startTime, endTime, maxAvgDay, e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user