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;
}
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;
}
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;
}
Aggregations