未验证 提交 553fe306 编写于 作者: Z ZQKC 提交者: GitHub

Merge pull request #29 from ZQKC/master

fix underReplicatedPartitionCount and add cluster
...@@ -10,6 +10,7 @@ import com.xiaojukeji.kafka.manager.dao.ClusterDao; ...@@ -10,6 +10,7 @@ import com.xiaojukeji.kafka.manager.dao.ClusterDao;
import com.xiaojukeji.kafka.manager.dao.ClusterMetricsDao; import com.xiaojukeji.kafka.manager.dao.ClusterMetricsDao;
import com.xiaojukeji.kafka.manager.dao.ControllerDao; import com.xiaojukeji.kafka.manager.dao.ControllerDao;
import com.xiaojukeji.kafka.manager.service.cache.ClusterMetadataManager; import com.xiaojukeji.kafka.manager.service.cache.ClusterMetadataManager;
import com.xiaojukeji.kafka.manager.service.schedule.ScheduleCollectDataManager;
import com.xiaojukeji.kafka.manager.service.service.ClusterService; import com.xiaojukeji.kafka.manager.service.service.ClusterService;
import org.apache.zookeeper.ZooKeeper; import org.apache.zookeeper.ZooKeeper;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -37,6 +38,9 @@ public class ClusterServiceImpl implements ClusterService { ...@@ -37,6 +38,9 @@ public class ClusterServiceImpl implements ClusterService {
@Autowired @Autowired
private ClusterMetadataManager clusterMetadataManager; private ClusterMetadataManager clusterMetadataManager;
@Autowired
private ScheduleCollectDataManager scheduleCollectDataManager;
@Autowired @Autowired
private ControllerDao controllerDao; private ControllerDao controllerDao;
...@@ -57,6 +61,7 @@ public class ClusterServiceImpl implements ClusterService { ...@@ -57,6 +61,7 @@ public class ClusterServiceImpl implements ClusterService {
if (!status) { if (!status) {
return new Result(StatusCode.OPERATION_ERROR, "add zookeeper watch failed"); return new Result(StatusCode.OPERATION_ERROR, "add zookeeper watch failed");
} }
scheduleCollectDataManager.start(clusterDO);
if (clusterDO.getAlarmFlag() == null || clusterDO.getAlarmFlag() <= 0) { if (clusterDO.getAlarmFlag() == null || clusterDO.getAlarmFlag() <= 0) {
return new Result(); return new Result();
......
...@@ -78,6 +78,7 @@ public class BrokerModelConverter { ...@@ -78,6 +78,7 @@ public class BrokerModelConverter {
Double bytesInPerSec = brokerOverallDTO.getBytesInPerSec() / 1024.0 / 1024.0; Double bytesInPerSec = brokerOverallDTO.getBytesInPerSec() / 1024.0 / 1024.0;
brokerOverviewVO.setBytesInPerSec(Math.round(bytesInPerSec * 100) / 100.0); brokerOverviewVO.setBytesInPerSec(Math.round(bytesInPerSec * 100) / 100.0);
} }
brokerOverviewVO.setUnderReplicatedPartitionCount(brokerOverallDTO.getUnderReplicatedPartitions());
brokerOverviewVO.setLeaderCount(brokerOverallDTO.getLeaderCount()); brokerOverviewVO.setLeaderCount(brokerOverallDTO.getLeaderCount());
if (brokerOverallDTO.getPartitionCount() != null && brokerOverallDTO.getUnderReplicatedPartitions() != null) { if (brokerOverallDTO.getPartitionCount() != null && brokerOverallDTO.getUnderReplicatedPartitions() != null) {
brokerOverviewVO.setNotUnderReplicatedPartitionCount(brokerOverallDTO.getPartitionCount() - brokerOverallDTO.getUnderReplicatedPartitions()); brokerOverviewVO.setNotUnderReplicatedPartitionCount(brokerOverallDTO.getPartitionCount() - brokerOverallDTO.getUnderReplicatedPartitions());
......
...@@ -30,9 +30,13 @@ public class BrokerOverallVO { ...@@ -30,9 +30,13 @@ public class BrokerOverallVO {
@ApiModelProperty(value = "分区数") @ApiModelProperty(value = "分区数")
private Integer partitionCount; private Integer partitionCount;
@ApiModelProperty(value = "未同步分区数") @Deprecated
@ApiModelProperty(value = "同步分区数")
private Integer notUnderReplicatedPartitionCount; private Integer notUnderReplicatedPartitionCount;
@ApiModelProperty(value = "未同步分区数")
private Integer underReplicatedPartitionCount;
@ApiModelProperty(value = "leader数") @ApiModelProperty(value = "leader数")
private Integer leaderCount; private Integer leaderCount;
...@@ -103,6 +107,14 @@ public class BrokerOverallVO { ...@@ -103,6 +107,14 @@ public class BrokerOverallVO {
this.notUnderReplicatedPartitionCount = notUnderReplicatedPartitionCount; this.notUnderReplicatedPartitionCount = notUnderReplicatedPartitionCount;
} }
public Integer getUnderReplicatedPartitionCount() {
return underReplicatedPartitionCount;
}
public void setUnderReplicatedPartitionCount(Integer underReplicatedPartitionCount) {
this.underReplicatedPartitionCount = underReplicatedPartitionCount;
}
public Integer getLeaderCount() { public Integer getLeaderCount() {
return leaderCount; return leaderCount;
} }
...@@ -130,6 +142,7 @@ public class BrokerOverallVO { ...@@ -130,6 +142,7 @@ public class BrokerOverallVO {
", bytesInPerSec=" + bytesInPerSec + ", bytesInPerSec=" + bytesInPerSec +
", partitionCount=" + partitionCount + ", partitionCount=" + partitionCount +
", notUnderReplicatedPartitionCount=" + notUnderReplicatedPartitionCount + ", notUnderReplicatedPartitionCount=" + notUnderReplicatedPartitionCount +
", underReplicatedPartitionCount=" + underReplicatedPartitionCount +
", leaderCount=" + leaderCount + ", leaderCount=" + leaderCount +
", regionName='" + regionName + '\'' + ", regionName='" + regionName + '\'' +
'}'; '}';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册