Search in sources :

Example 6 with DefaultCDHInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo in project cloudbreak by hortonworks.

the class ParcelMockActivatorUtil method getDefaultApiParcels.

private List<ApiParcel> getDefaultApiParcels(MockedTestContext testContext) {
    String blueprintCdhVersion = testContext.getCloudProvider().getBlueprintCdhVersion();
    DefaultCDHInfo defaultCDHInfo = inTestCdhParcelProvider.getParcels(blueprintCdhVersion).get(blueprintCdhVersion);
    return defaultCDHInfo.getParcels().stream().map(product -> {
        ApiParcel apiParcel = new ApiParcel();
        apiParcel.setVersion(product.getVersion());
        apiParcel.setProduct(product.getName());
        apiParcel.setStage("ACTIVATED");
        ApiParcelState state = new ApiParcelState();
        state.setCount(new BigDecimal(0));
        apiParcel.setState(state);
        return apiParcel;
    }).collect(Collectors.toList());
}
Also used : Arrays(java.util.Arrays) MockedTestContext(com.sequenceiq.it.cloudbreak.context.MockedTestContext) Logger(org.slf4j.Logger) Collection(java.util.Collection) LoggerFactory(org.slf4j.LoggerFactory) DefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo) ApiParcel(com.cloudera.api.swagger.model.ApiParcel) Collectors(java.util.stream.Collectors) StringUtils(org.apache.commons.lang3.StringUtils) CollectionUtils(org.apache.commons.collections4.CollectionUtils) Inject(javax.inject.Inject) BigDecimal(java.math.BigDecimal) InTestCdhParcelProvider(com.sequenceiq.it.config.InTestCdhParcelProvider) List(java.util.List) Component(org.springframework.stereotype.Component) TestFailException(com.sequenceiq.it.cloudbreak.exception.TestFailException) ApiParcelList(com.cloudera.api.swagger.model.ApiParcelList) ApiParcelState(com.cloudera.api.swagger.model.ApiParcelState) ApiParcel(com.cloudera.api.swagger.model.ApiParcel) DefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo) BigDecimal(java.math.BigDecimal) ApiParcelState(com.cloudera.api.swagger.model.ApiParcelState)

Example 7 with DefaultCDHInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo in project cloudbreak by hortonworks.

the class RepoTestUtil method getDefaultCDHInfo.

public static DefaultCDHInfo getDefaultCDHInfo(String version) {
    DefaultCDHInfo defaultCDHInfo = new DefaultCDHInfo();
    defaultCDHInfo.setVersion(version);
    defaultCDHInfo.setRepo(getCMStackRepoDetails(version));
    return defaultCDHInfo;
}
Also used : DefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo)

Example 8 with DefaultCDHInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo in project cloudbreak by hortonworks.

the class StackMatrixServiceTest method setupStackEntries.

private void setupStackEntries() throws Exception {
    Map<String, ImageBasedDefaultCDHInfo> cdhEntries = new HashMap<>();
    DefaultCDHInfo cdhInfo = getDefaultCDHInfo("6.1.0-1.cdh6.1.0.p0.770702");
    cdhEntries.put("6.1.0", new ImageBasedDefaultCDHInfo(cdhInfo, mock(Image.class)));
    when(stackInfoToClouderaManagerStackDescriptorV4ResponseConverter.convert(cdhInfo)).thenReturn(getCMStackDescriptorResponse("6.1.0-1.cdh6.1.0.p0.770702"));
    when(imageBasedDefaultCDHEntries.getEntries(WORKSPACE_ID, IMAGECATALOGPLATFORM, IMAGE_CATALOG_NAME)).thenReturn(cdhEntries);
}
Also used : ImageBasedDefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.ImageBasedDefaultCDHInfo) DefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo) RepoTestUtil.getDefaultCDHInfo(com.sequenceiq.cloudbreak.RepoTestUtil.getDefaultCDHInfo) HashMap(java.util.HashMap) ImageBasedDefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.ImageBasedDefaultCDHInfo)

Example 9 with DefaultCDHInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo in project cloudbreak by hortonworks.

the class StackMatrixService method getImageBasedStackMatrix.

private StackMatrixV4Response getImageBasedStackMatrix(Long workspaceId, ImageCatalogPlatform platform, String imageCatalogName) throws CloudbreakImageCatalogException {
    Map<String, ImageBasedDefaultCDHInfo> cdhEntries = imageBasedDefaultCDHEntries.getEntries(workspaceId, platform, imageCatalogName);
    StackMatrixV4Response stackMatrixV4Response = new StackMatrixV4Response();
    Map<String, ClouderaManagerStackDescriptorV4Response> cdhStackDescriptors = new HashMap<>();
    for (Entry<String, ImageBasedDefaultCDHInfo> defaultCDHInfoEntry : cdhEntries.entrySet()) {
        DefaultCDHInfo defaultCDHInfo = defaultCDHInfoEntry.getValue().getDefaultCDHInfo();
        Image image = defaultCDHInfoEntry.getValue().getImage();
        ClouderaManagerStackDescriptorV4Response stackDescriptorV4 = getImageBasedCMStackDescriptor(defaultCDHInfo, image);
        cdhStackDescriptors.put(defaultCDHInfoEntry.getKey(), stackDescriptorV4);
    }
    stackMatrixV4Response.setCdh(cdhStackDescriptors);
    return stackMatrixV4Response;
}
Also used : ImageBasedDefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.ImageBasedDefaultCDHInfo) DefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo) HashMap(java.util.HashMap) ImageBasedDefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.ImageBasedDefaultCDHInfo) ClouderaManagerStackDescriptorV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ClouderaManagerStackDescriptorV4Response) Image(com.sequenceiq.cloudbreak.cloud.model.catalog.Image) StackMatrixV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.StackMatrixV4Response)

Example 10 with DefaultCDHInfo

use of com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo in project cloudbreak by hortonworks.

the class InTestCdhParcelProvider method getParcels.

public Map<String, DefaultCDHInfo> getParcels(String runtimeVersion) {
    Map<String, DefaultCDHInfo> cdhParcels = new HashMap<>();
    DefaultCDHInfo defaultCDHInfo = new DefaultCDHInfo();
    ClouderaManagerProduct schemaRegistry = new ClouderaManagerProduct();
    schemaRegistry.setParcel("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/3.0.0.0-123/tars/parcel");
    schemaRegistry.setName("SCHEMAREGISTRY");
    schemaRegistry.setVersion("0.8.1.3.0.0.0-123");
    schemaRegistry.setCsd(Lists.newArrayList("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/" + "3.0.0.0-123/tars/parcel/SCHEMAREGISTRY-0.8.1.jar"));
    ClouderaManagerProduct streamsMessagingManager = new ClouderaManagerProduct();
    streamsMessagingManager.setParcel("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/3.0.0.0-123/tars/parcel");
    streamsMessagingManager.setName("STREAMS_MESSAGING_MANAGER");
    streamsMessagingManager.setVersion("2.1.0.3.0.0.0-123");
    streamsMessagingManager.setCsd(Lists.newArrayList("http://s3.amazonaws.com/dev.hortonworks.com/CSP/centos7/3.x/BUILDS/" + "3.0.0.0-123/tars/parcel/STREAMS_MESSAGING_MANAGER-2.1.0.jar"));
    ClouderaManagerProduct cfm = new ClouderaManagerProduct();
    cfm.setParcel("http://s3.amazonaws.com/dev.hortonworks.com/CFM/centos7/2.x/BUILDS/2.0.0.0-213/tars/parcel");
    cfm.setName("CFM");
    cfm.setVersion("2.0.0.0");
    cfm.setCsd(Lists.newArrayList("http://s3.amazonaws.com/dev.hortonworks.com/CFM/centos7/2.x/BUILDS/2.0.0.0-213/" + "tars/parcel/NIFI-1.11.4.2.0.0.0-213.jar"));
    ClouderaManagerDefaultStackRepoDetails cm = new ClouderaManagerDefaultStackRepoDetails();
    cm.setCdhVersion("CDH-" + runtimeVersion);
    Map<String, String> stack = new HashMap<>();
    stack.put("redhat7", "http://cloudera-build-us-west-1.vpc.cloudera.com/s3/build/1423385/cdh/7.x/parcels/");
    stack.put("centos7", "http://cloudera-build-us-west-1.vpc.cloudera.com/s3/build/1423385/cdh/7.x/parcels/");
    cm.setStack(stack);
    defaultCDHInfo.setParcels(Lists.newArrayList(schemaRegistry, streamsMessagingManager, cfm));
    defaultCDHInfo.setVersion(runtimeVersion);
    defaultCDHInfo.setRepo(cm);
    cdhParcels.put(runtimeVersion, defaultCDHInfo);
    return cdhParcels;
}
Also used : ClouderaManagerDefaultStackRepoDetails(com.sequenceiq.cloudbreak.cloud.model.component.ClouderaManagerDefaultStackRepoDetails) DefaultCDHInfo(com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo) HashMap(java.util.HashMap) ClouderaManagerProduct(com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)

Aggregations

DefaultCDHInfo (com.sequenceiq.cloudbreak.cloud.model.component.DefaultCDHInfo)11 ImageBasedDefaultCDHInfo (com.sequenceiq.cloudbreak.cloud.model.component.ImageBasedDefaultCDHInfo)8 StackMatrixV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.StackMatrixV4Response)6 ClouderaManagerStackDescriptorV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.util.responses.ClouderaManagerStackDescriptorV4Response)5 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)4 ClouderaManagerProduct (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerProduct)4 Image (com.sequenceiq.cloudbreak.cloud.model.Image)4 Json (com.sequenceiq.cloudbreak.common.json.Json)4 Component (com.sequenceiq.cloudbreak.domain.stack.Component)4 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)4 HashMap (java.util.HashMap)4 List (java.util.List)4 Collectors (java.util.stream.Collectors)4 Inject (javax.inject.Inject)4 Logger (org.slf4j.Logger)4 LoggerFactory (org.slf4j.LoggerFactory)4 ClouderaManagerV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.ClouderaManagerV4Request)3 ClouderaManagerProductV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.product.ClouderaManagerProductV4Request)3 ClouderaManagerRepositoryV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.cm.repository.ClouderaManagerRepositoryV4Request)3 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)3