Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Allow logging to be enabled for ensurePaAndRcaEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Sid Narayan committed Jul 8, 2020
1 parent a270904 commit 93e8b28
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,17 @@ public static void ensurePaAndRcaEnabled() throws Exception {
Response resp = client().performRequest(new Request("GET", "_opendistro/_performanceanalyzer/cluster/config"));
Map<String, Object> respMap = mapper.readValue(EntityUtils.toString(resp.getEntity(), "UTF-8"),
new TypeReference<Map<String, Object>>(){});
if (respMap.get("currentPerformanceAnalyzerClusterState").equals(3)) {
if (respMap.get("currentPerformanceAnalyzerClusterState").equals(3) &&
!respMap.get("currentPerformanceAnalyzerClusterState").equals(7)) {
break;
}
Thread.sleep(1000L);
}
Response resp = client().performRequest(new Request("GET", "_opendistro/_performanceanalyzer/cluster/config"));
Map<String, Object> respMap = mapper.readValue(EntityUtils.toString(resp.getEntity(), "UTF-8"),
new TypeReference<Map<String, Object>>(){});
if (!respMap.get("currentPerformanceAnalyzerClusterState").equals(3)) {
if (!respMap.get("currentPerformanceAnalyzerClusterState").equals(3) &&
!respMap.get("currentPerformanceAnalyzerClusterState").equals(7)) {
throw new Exception("PA and RCA are not enabled on the target cluster!");
}
}
Expand Down

0 comments on commit 93e8b28

Please sign in to comment.