use of com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadata in project cloudbreak by hortonworks.
the class OrchestratorService method getOrchestratorMetadata.
@Override
public OrchestratorMetadata getOrchestratorMetadata(Long stackId) {
Stack stack = stackService.getByIdWithListsInTransaction(stackId);
List<GatewayConfig> gatewayConfigs = gatewayConfigService.getAllGatewayConfigs(stack);
ClusterDeletionBasedExitCriteriaModel exitModel = new ClusterDeletionBasedExitCriteriaModel(stackId, stack.getCluster().getId());
return new OrchestratorMetadata(gatewayConfigs, stack.getAllNodes(), exitModel, stack);
}
use of com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadata in project cloudbreak by hortonworks.
the class TelemetryUpgradeService method updateSaltStateForComponents.
private void updateSaltStateForComponents(Long stackId, Set<TelemetryOrchestratorModule> components, byte[] telemetrySaltStateConfigs) throws CloudbreakOrchestratorFailedException {
List<String> componentNames = components.stream().map(TelemetryOrchestratorModule::getValue).collect(Collectors.toList());
OrchestratorMetadata metadata = orchestratorMetadataProvider.getOrchestratorMetadata(stackId);
telemetryOrchestrator.updatePartialSaltDefinition(telemetrySaltStateConfigs, componentNames, metadata.getGatewayConfigs(), metadata.getExitCriteriaModel());
}
use of com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadata in project cloudbreak by hortonworks.
the class TelemetryUpgradeService method upgradeTelemetrySaltPillars.
public void upgradeTelemetrySaltPillars(Long stackId, Set<TelemetryComponentType> components) throws CloudbreakOrchestratorFailedException {
OrchestratorMetadata metadata = orchestratorMetadataProvider.getOrchestratorMetadata(stackId);
Set<Node> availableNodes = collectAvailableNodes(metadata);
if (CollectionUtils.isEmpty(availableNodes)) {
String message = "Not found any available nodes for stack: " + stackId;
LOGGER.info(message);
throw new CloudbreakOrchestratorFailedException(message);
} else {
Map<String, SaltPillarProperties> pillarPropMap = telemetryConfigProvider.createTelemetryConfigs(stackId, components);
SaltConfig saltConfig = new SaltConfig(pillarPropMap);
hostOrchestrator.initSaltConfig(metadata.getStack(), metadata.getGatewayConfigs(), availableNodes, saltConfig, metadata.getExitCriteriaModel());
}
}
use of com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadata in project cloudbreak by hortonworks.
the class DiagnosticsFlowService method collectNodeStatusTelemetry.
public void collectNodeStatusTelemetry(Long stackId) throws CloudbreakOrchestratorFailedException {
OrchestratorMetadata metadata = orchestratorMetadataProvider.getOrchestratorMetadata(stackId);
Set<Node> allNodes = metadata.getNodes();
if (allNodes.isEmpty()) {
LOGGER.debug("Nodestatus telemetry collection has been skipped. (no target minions)");
} else {
telemetryOrchestrator.executeNodeStatusCollection(metadata.getGatewayConfigs(), allNodes, metadata.getExitCriteriaModel());
}
}
use of com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadata in project cloudbreak by hortonworks.
the class OrchestratorServiceTest method testGetOrchestratorMetadata.
@Test
public void testGetOrchestratorMetadata() {
// GIVEN
given(stackService.getByIdWithListsInTransaction(STACK_ID)).willReturn(stack());
given(gatewayConfigService.getAllGatewayConfigs(any())).willReturn(new ArrayList<>());
// WHEN
OrchestratorMetadata result = underTest.getOrchestratorMetadata(STACK_ID);
// THEN
assertNotNull(result);
verify(gatewayConfigService, times(1)).getAllGatewayConfigs(any());
}
Aggregations