@Test public void filtersAppropriateHealthCheckForHost() throws ApiException { hostsAre( new ApiHost().hostname("host") .addHealthChecksItem(new ApiHealthCheck().name("fake_check").summary(ApiHealthSummary.BAD)) .addHealthChecksItem(new ApiHealthCheck().name(HOST_SCM_HEALTH).summary(ApiHealthSummary.CONCERNING)) .addHealthChecksItem(new ApiHealthCheck().name("another").summary(ApiHealthSummary.BAD)) ); Map<HostName, ClusterManagerStatus> expected = Collections.singletonMap(hostName("host"), ClusterManagerStatus.HEALTHY); assertEquals(expected, subject.getHostStatuses()); }
@Override public Map<HostName, ClusterManagerState.ClusterManagerStatus> getHostStatuses() { return convertHealthSummary(getHostHealthSummary(), ClouderaManagerClusterStatusService::healthSummaryToState); }
ClouderaManagerClusterStatusService implements ClusterStatusService { @Override public Map<HostName, ClusterManagerState.ClusterManagerStatus> getHostStatuses() { return convertHealthSummary(getHostHealthSummary(), ClouderaManagerClusterStatusService::healthSummaryToState); } }
ClouderaManagerClusterStatusService implements ClusterStatusService { @Override public Map<HostName, ClusterManagerState.ClusterManagerStatus> getHostStatuses() { return convertHealthSummary(getHostHealthSummary(), ClouderaManagerClusterStatusService::healthSummaryToState); } ClouderaManagerClusterStatusService(Stack stack, HttpClientConfig clientConfig); }
ClouderaManagerClusterStatusService implements ClusterStatusService { @Override public Map<HostName, ClusterManagerState.ClusterManagerStatus> getHostStatuses() { return convertHealthSummary(getHostHealthSummary(), ClouderaManagerClusterStatusService::healthSummaryToState); } ClouderaManagerClusterStatusService(Stack stack, HttpClientConfig clientConfig); @PostConstruct void initApiClient(); @Override ClusterStatusResult getStatus(boolean blueprintPresent); @Override ExtendedHostStatuses getExtendedHostStatuses(); @Override Map<HostName, ClusterManagerState.ClusterManagerStatus> getHostStatuses(); @Override Map<HostName, String> getHostStatusesRaw(); @Override boolean isClusterManagerRunning(); }
ClouderaManagerClusterStatusService implements ClusterStatusService { @Override public Map<HostName, ClusterManagerState.ClusterManagerStatus> getHostStatuses() { return convertHealthSummary(getHostHealthSummary(), ClouderaManagerClusterStatusService::healthSummaryToState); } ClouderaManagerClusterStatusService(Stack stack, HttpClientConfig clientConfig); @PostConstruct void initApiClient(); @Override ClusterStatusResult getStatus(boolean blueprintPresent); @Override ExtendedHostStatuses getExtendedHostStatuses(); @Override Map<HostName, ClusterManagerState.ClusterManagerStatus> getHostStatuses(); @Override Map<HostName, String> getHostStatusesRaw(); @Override boolean isClusterManagerRunning();  }