Search in sources :

Example 1 with PackageName

use of com.sequenceiq.cloudbreak.service.cluster.PackageName in project cloudbreak by hortonworks.

the class CmVersionQueryServiceTest method generatePackageName.

private PackageName generatePackageName(String pkg, String pattern) {
    PackageName packageName = new PackageName();
    packageName.setName(pkg);
    packageName.setPattern(pattern);
    return packageName;
}
Also used : PackageName(com.sequenceiq.cloudbreak.service.cluster.PackageName)

Example 2 with PackageName

use of com.sequenceiq.cloudbreak.service.cluster.PackageName in project cloudbreak by hortonworks.

the class InstanceMetadataUpdaterTest method generatePackageName.

private PackageName generatePackageName(String pkg, String pattern) {
    PackageName packageName = new PackageName();
    packageName.setName(pkg);
    packageName.setPattern(pattern);
    return packageName;
}
Also used : PackageName(com.sequenceiq.cloudbreak.service.cluster.PackageName)

Example 3 with PackageName

use of com.sequenceiq.cloudbreak.service.cluster.PackageName in project cloudbreak by hortonworks.

the class CmVersionQueryService method queryCmPackageInfo.

/**
 * Will query all CM related package versions (CM server and CM agent as well) from the nodes.
 * <p>
 *
 * @param stack The stack, with metadata to be able to build the client to query package versions
 * @return List of package info found in each host (map key is host fqdn)
 */
Map<String, List<PackageInfo>> queryCmPackageInfo(Stack stack) throws CloudbreakOrchestratorFailedException {
    GatewayConfig gatewayConfig = gatewayConfigService.getPrimaryGatewayConfig(stack);
    Map<String, Optional<String>> packageMap = packages.stream().filter(aPackage -> aPackage.getName().equals(ImagePackageVersion.CM.getKey())).map(Package::getPkg).flatMap(List::stream).collect(Collectors.toMap(PackageName::getName, packageName -> Optional.ofNullable(packageName.getPattern())));
    Map<String, List<PackageInfo>> fullPackageVersionsFromAllHosts = hostOrchestrator.getFullPackageVersionsFromAllHosts(gatewayConfig, packageMap);
    LOGGER.debug("Reading CM package info, found packages: " + fullPackageVersionsFromAllHosts);
    return fullPackageVersionsFromAllHosts;
}
Also used : Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) HostOrchestrator(com.sequenceiq.cloudbreak.orchestrator.host.HostOrchestrator) Logger(org.slf4j.Logger) PackageInfo(com.sequenceiq.cloudbreak.common.model.PackageInfo) LoggerFactory(org.slf4j.LoggerFactory) Set(java.util.Set) ConfigurationProperties(org.springframework.boot.context.properties.ConfigurationProperties) Multimap(com.google.common.collect.Multimap) Collectors(java.util.stream.Collectors) HashSet(java.util.HashSet) Inject(javax.inject.Inject) GatewayConfigService(com.sequenceiq.cloudbreak.service.GatewayConfigService) List(java.util.List) Component(org.springframework.stereotype.Component) HashMultimap(com.google.common.collect.HashMultimap) ImagePackageVersion(com.sequenceiq.cloudbreak.cloud.model.catalog.ImagePackageVersion) CloudbreakOrchestratorFailedException(com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException) Map(java.util.Map) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) GatewayConfig(com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig) Package(com.sequenceiq.cloudbreak.service.cluster.Package) Optional(java.util.Optional) PackageName(com.sequenceiq.cloudbreak.service.cluster.PackageName) Optional(java.util.Optional) List(java.util.List) Package(com.sequenceiq.cloudbreak.service.cluster.Package) GatewayConfig(com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)

Aggregations

PackageName (com.sequenceiq.cloudbreak.service.cluster.PackageName)3 HashMultimap (com.google.common.collect.HashMultimap)1 Multimap (com.google.common.collect.Multimap)1 ImagePackageVersion (com.sequenceiq.cloudbreak.cloud.model.catalog.ImagePackageVersion)1 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)1 PackageInfo (com.sequenceiq.cloudbreak.common.model.PackageInfo)1 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)1 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)1 HostOrchestrator (com.sequenceiq.cloudbreak.orchestrator.host.HostOrchestrator)1 GatewayConfig (com.sequenceiq.cloudbreak.orchestrator.model.GatewayConfig)1 GatewayConfigService (com.sequenceiq.cloudbreak.service.GatewayConfigService)1 Package (com.sequenceiq.cloudbreak.service.cluster.Package)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 Collectors (java.util.stream.Collectors)1 Inject (javax.inject.Inject)1 Logger (org.slf4j.Logger)1