@Test public void specificVersionUsedIfAvailable() throws IOException, CloudbreakImageCatalogException { Set<ClouderaManagerProduct> clouderaManagerProductSet = new HashSet<>(); clouderaManagerProductSet.add(clouderaManagerProduct("CDH", "1.0.0")); when(blueprintUtils.getCDHStackVersion(any())).thenReturn(OLDER_CDH_VERSION); when(parcelService.filterParcelsByBlueprint(anySet(), any(Blueprint.class), anyBoolean())).thenReturn(clouderaManagerProductSet); List<ClusterComponent> clusterComponents = underTest.prepareClouderaManagerCluster(clusterRequest, cluster, Optional.empty(), List.of(), Optional.of(imageComponent)); assertVersionsMatch(clusterComponents, DEFAULT_CM_VERSION, OLDER_CDH_VERSION); verify(parcelService, times(1)).filterParcelsByBlueprint(anySet(), any(Blueprint.class), anyBoolean()); }
public List<ClusterComponent> prepareClouderaManagerCluster(ClusterV4Request request, Cluster cluster, Optional<Component> stackClouderaManagerRepoConfig, List<Component> stackCdhRepoConfig, Optional<Component> stackImageComponent) throws IOException, CloudbreakImageCatalogException { List<ClusterComponent> components = new ArrayList<>(); long start = System.currentTimeMillis(); String blueprintCdhVersion = blueprintUtils.getCDHStackVersion(JsonUtil.readTree(cluster.getBlueprint().getBlueprintText())); LOGGER.debug("blueprintUtils.getCDHStackVersion took {} ms", System.currentTimeMillis() - start); Optional<ClouderaManagerRepositoryV4Request> cmRepoRequest = measure(() -> Optional.ofNullable(request.getCm()).map(ClouderaManagerV4Request::getRepository), LOGGER, "ClouderaManagerV4Request::getRepository {} ms"); start = System.currentTimeMillis(); String osType = getOsType(stackImageComponent); String imageCatalogName = getImageCatalogName(stackImageComponent); LOGGER.debug("getImageCatalogName took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); ClusterComponent cmRepoConfig = getCmRepoConfiguration(cluster, stackClouderaManagerRepoConfig, components, blueprintCdhVersion, cmRepoRequest, osType); LOGGER.debug("getCmRepoConfiguration took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); checkCmStackRepositories(cmRepoConfig, stackImageComponent.get()); LOGGER.debug("checkCmStackRepositories took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); addProductComponentsToCluster(request, cluster, stackCdhRepoConfig, components, blueprintCdhVersion, osType, imageCatalogName); LOGGER.debug("addProductComponentsToCluster took {} ms", System.currentTimeMillis() - start); return components; }
ClouderaManagerClusterCreationSetupService { public List<ClusterComponent> prepareClouderaManagerCluster(ClusterV4Request request, Cluster cluster, Optional<Component> stackClouderaManagerRepoConfig, List<Component> stackCdhRepoConfig, Optional<Component> stackImageComponent) throws IOException, CloudbreakImageCatalogException { List<ClusterComponent> components = new ArrayList<>(); long start = System.currentTimeMillis(); String blueprintCdhVersion = blueprintUtils.getCDHStackVersion(JsonUtil.readTree(cluster.getBlueprint().getBlueprintText())); LOGGER.debug("blueprintUtils.getCDHStackVersion took {} ms", System.currentTimeMillis() - start); Optional<ClouderaManagerRepositoryV4Request> cmRepoRequest = measure(() -> Optional.ofNullable(request.getCm()).map(ClouderaManagerV4Request::getRepository), LOGGER, "ClouderaManagerV4Request::getRepository {} ms"); start = System.currentTimeMillis(); String osType = getOsType(stackImageComponent); String imageCatalogName = getImageCatalogName(stackImageComponent); LOGGER.debug("getImageCatalogName took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); ClusterComponent cmRepoConfig = getCmRepoConfiguration(cluster, stackClouderaManagerRepoConfig, components, blueprintCdhVersion, cmRepoRequest, osType); LOGGER.debug("getCmRepoConfiguration took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); checkCmStackRepositories(cmRepoConfig, stackImageComponent.get()); LOGGER.debug("checkCmStackRepositories took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); addProductComponentsToCluster(request, cluster, stackCdhRepoConfig, components, blueprintCdhVersion, osType, imageCatalogName); LOGGER.debug("addProductComponentsToCluster took {} ms", System.currentTimeMillis() - start); return components; } }
ClouderaManagerClusterCreationSetupService { public List<ClusterComponent> prepareClouderaManagerCluster(ClusterV4Request request, Cluster cluster, Optional<Component> stackClouderaManagerRepoConfig, List<Component> stackCdhRepoConfig, Optional<Component> stackImageComponent) throws IOException, CloudbreakImageCatalogException { List<ClusterComponent> components = new ArrayList<>(); long start = System.currentTimeMillis(); String blueprintCdhVersion = blueprintUtils.getCDHStackVersion(JsonUtil.readTree(cluster.getBlueprint().getBlueprintText())); LOGGER.debug("blueprintUtils.getCDHStackVersion took {} ms", System.currentTimeMillis() - start); Optional<ClouderaManagerRepositoryV4Request> cmRepoRequest = measure(() -> Optional.ofNullable(request.getCm()).map(ClouderaManagerV4Request::getRepository), LOGGER, "ClouderaManagerV4Request::getRepository {} ms"); start = System.currentTimeMillis(); String osType = getOsType(stackImageComponent); String imageCatalogName = getImageCatalogName(stackImageComponent); LOGGER.debug("getImageCatalogName took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); ClusterComponent cmRepoConfig = getCmRepoConfiguration(cluster, stackClouderaManagerRepoConfig, components, blueprintCdhVersion, cmRepoRequest, osType); LOGGER.debug("getCmRepoConfiguration took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); checkCmStackRepositories(cmRepoConfig, stackImageComponent.get()); LOGGER.debug("checkCmStackRepositories took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); addProductComponentsToCluster(request, cluster, stackCdhRepoConfig, components, blueprintCdhVersion, osType, imageCatalogName); LOGGER.debug("addProductComponentsToCluster took {} ms", System.currentTimeMillis() - start); return components; }  }
ClouderaManagerClusterCreationSetupService { public List<ClusterComponent> prepareClouderaManagerCluster(ClusterV4Request request, Cluster cluster, Optional<Component> stackClouderaManagerRepoConfig, List<Component> stackCdhRepoConfig, Optional<Component> stackImageComponent) throws IOException, CloudbreakImageCatalogException { List<ClusterComponent> components = new ArrayList<>(); long start = System.currentTimeMillis(); String blueprintCdhVersion = blueprintUtils.getCDHStackVersion(JsonUtil.readTree(cluster.getBlueprint().getBlueprintText())); LOGGER.debug("blueprintUtils.getCDHStackVersion took {} ms", System.currentTimeMillis() - start); Optional<ClouderaManagerRepositoryV4Request> cmRepoRequest = measure(() -> Optional.ofNullable(request.getCm()).map(ClouderaManagerV4Request::getRepository), LOGGER, "ClouderaManagerV4Request::getRepository {} ms"); start = System.currentTimeMillis(); String osType = getOsType(stackImageComponent); String imageCatalogName = getImageCatalogName(stackImageComponent); LOGGER.debug("getImageCatalogName took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); ClusterComponent cmRepoConfig = getCmRepoConfiguration(cluster, stackClouderaManagerRepoConfig, components, blueprintCdhVersion, cmRepoRequest, osType); LOGGER.debug("getCmRepoConfiguration took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); checkCmStackRepositories(cmRepoConfig, stackImageComponent.get()); LOGGER.debug("checkCmStackRepositories took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); addProductComponentsToCluster(request, cluster, stackCdhRepoConfig, components, blueprintCdhVersion, osType, imageCatalogName); LOGGER.debug("addProductComponentsToCluster took {} ms", System.currentTimeMillis() - start); return components; }  List<ClusterComponent> prepareClouderaManagerCluster(ClusterV4Request request, Cluster cluster,
            Optional<Component> stackClouderaManagerRepoConfig,
            List<Component> stackCdhRepoConfig,
            Optional<Component> stackImageComponent); }
ClouderaManagerClusterCreationSetupService { public List<ClusterComponent> prepareClouderaManagerCluster(ClusterV4Request request, Cluster cluster, Optional<Component> stackClouderaManagerRepoConfig, List<Component> stackCdhRepoConfig, Optional<Component> stackImageComponent) throws IOException, CloudbreakImageCatalogException { List<ClusterComponent> components = new ArrayList<>(); long start = System.currentTimeMillis(); String blueprintCdhVersion = blueprintUtils.getCDHStackVersion(JsonUtil.readTree(cluster.getBlueprint().getBlueprintText())); LOGGER.debug("blueprintUtils.getCDHStackVersion took {} ms", System.currentTimeMillis() - start); Optional<ClouderaManagerRepositoryV4Request> cmRepoRequest = measure(() -> Optional.ofNullable(request.getCm()).map(ClouderaManagerV4Request::getRepository), LOGGER, "ClouderaManagerV4Request::getRepository {} ms"); start = System.currentTimeMillis(); String osType = getOsType(stackImageComponent); String imageCatalogName = getImageCatalogName(stackImageComponent); LOGGER.debug("getImageCatalogName took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); ClusterComponent cmRepoConfig = getCmRepoConfiguration(cluster, stackClouderaManagerRepoConfig, components, blueprintCdhVersion, cmRepoRequest, osType); LOGGER.debug("getCmRepoConfiguration took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); checkCmStackRepositories(cmRepoConfig, stackImageComponent.get()); LOGGER.debug("checkCmStackRepositories took {} ms", System.currentTimeMillis() - start); start = System.currentTimeMillis(); addProductComponentsToCluster(request, cluster, stackCdhRepoConfig, components, blueprintCdhVersion, osType, imageCatalogName); LOGGER.debug("addProductComponentsToCluster took {} ms", System.currentTimeMillis() - start); return components; }  List<ClusterComponent> prepareClouderaManagerCluster(ClusterV4Request request, Cluster cluster,
            Optional<Component> stackClouderaManagerRepoConfig,
            List<Component> stackCdhRepoConfig,
            Optional<Component> stackImageComponent);  }