use of com.sequenceiq.node.health.client.model.CdpNodeStatusRequest in project cloudbreak by hortonworks.
the class NodeStatusCheckerJob method executeNodeStatusCheck.
private void executeNodeStatusCheck(Stack stack) {
boolean nodeStatusCheckEnabled = true;
CdpNodeStatusRequest.Builder requestBuilder = CdpNodeStatusRequest.Builder.builder();
String accountId = Crn.safeFromString(stack.getResourceCrn()).getAccountId();
if (StackType.WORKLOAD.equals(stack.getType())) {
nodeStatusCheckEnabled = entitlementService.datahubNodestatusCheckEnabled(accountId);
}
if (nodeStatusCheckEnabled) {
if (StackType.WORKLOAD.equals(stack.getType())) {
requestBuilder.withMetering(true);
}
CdpNodeStatusRequest request = requestBuilder.withCmMonitoring(true).withSkipObjectMapping(true).build();
CdpNodeStatuses statuses = nodeStatusService.getNodeStatuses(stack, request);
processNodeStatusReport(statuses.getNetworkReport(), NodeStatusProto.NodeStatus::getNetworkDetails, stack, "Network");
processNodeStatusReport(statuses.getServicesReport(), NodeStatusProto.NodeStatus::getServicesDetails, stack, "Services");
processNodeStatusReport(statuses.getSystemMetricsReport(), NodeStatusProto.NodeStatus::getSystemMetrics, stack, "System metrics");
processCmMetricsReport(statuses.getCmMetricsReport(), stack);
}
}
Aggregations