Skip to content

Commit

Permalink
#527 添加zk集群是否为空判断
Browse files Browse the repository at this point in the history
  • Loading branch information
lzw2006 committed Jan 3, 2019
1 parent 9c46edf commit 2397f92
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,13 @@ public Map<String, List> getDomainOperationHistory(String type, String topic, Da

List<String> zkClusters = getAvailableZkClusterKey();

if (zkClusters.isEmpty()) {
Map<String, List> result = new HashMap<>(2);
result.put("xAxis", null);
result.put("yAxis", null);
return result;
}

List<DashboardHistory> dashboardHistories = dashboardHistoryRepository
.selectByZkClustersAndTypeAndTopicAndFromStartDateToEndDate(zkClusters, type, topic, fromDate, toDate);

Expand Down Expand Up @@ -650,6 +657,13 @@ public Map<String, List> getDomainCountHistory(String zkCluster, String type, St
zkClusters.add(zkCluster);
}

if (zkClusters.isEmpty()) {
Map<String, List> result = new HashMap<>(2);
result.put("xAxis", null);
result.put("yAxis", null);
return result;
}

List<DashboardHistory> dashboardHistories = dashboardHistoryRepository
.selectByZkClustersAndTypeAndTopicAndFromStartDateToEndDate(zkClusters, type, topic, fromDate, toDate);

Expand Down Expand Up @@ -705,6 +719,13 @@ public Map<String, List> getExecutorHistory(String zkCluster, String type, Strin
zkClusters.add(zkCluster);
}

if (zkClusters.isEmpty()) {
Map<String, List> result = new HashMap<>(2);
result.put("xAxis", null);
result.put("yAxis", null);
return result;
}

List<DashboardHistory> dashboardHistories = dashboardHistoryRepository
.selectByZkClustersAndTypeAndTopicAndFromStartDateToEndDate(zkClusters, type, topic, fromDate, toDate);

Expand Down Expand Up @@ -774,6 +795,13 @@ public Map<String, List> getJobCountHistory(String zkCluster, String type, Strin
zkClusters.add(zkCluster);
}

if (zkClusters.isEmpty()) {
Map<String, List> result = new HashMap<>(2);
result.put("xAxis", null);
result.put("yAxis", null);
return result;
}

List<DashboardHistory> dashboardHistories = dashboardHistoryRepository
.selectByZkClustersAndTypeAndTopicAndFromStartDateToEndDate(zkClusters, type, topic, fromDate, toDate);

Expand Down

0 comments on commit 2397f92

Please sign in to comment.