use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class SqlStreamBuilderAdminDatabaseConfigProviderTest method initTemplatePreparationObject.
private TemplatePreparationObject initTemplatePreparationObject(CmTemplateProcessor cmTemplateProcessor) {
HostgroupView manager = new HostgroupView("manager", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.CORE, 2);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 3);
BlueprintView blueprintView = new BlueprintView(null, null, null, cmTemplateProcessor);
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setType(DatabaseType.SQL_STREAM_BUILDER_ADMIN.toString());
rdsConfig.setDatabaseEngine(DatabaseVendor.POSTGRES);
rdsConfig.setConnectionDriver(DatabaseVendor.POSTGRES.connectionDriver());
rdsConfig.setConnectionURL("jdbc:postgresql://testhost:5432/eventador_admin");
rdsConfig.setConnectionUserName("ssb_test_user");
rdsConfig.setConnectionPassword("ssb_test_pw");
return TemplatePreparationObject.Builder.builder().withBlueprintView(blueprintView).withHostgroupViews(Set.of(manager, master, worker)).withRdsConfigs(Set.of(rdsConfig)).build();
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverterTest method getBlueprintView.
private BlueprintView getBlueprintView() {
BlueprintView blueprint = new BlueprintView();
blueprint.setVersion("7.2.14");
return blueprint;
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class StackV4RequestToTemplatePreparationObjectConverterTest method testConvertWhenProvidingDataThenBlueprintWithExpectedDataShouldBeStored.
@Test
public void testConvertWhenProvidingDataThenBlueprintWithExpectedDataShouldBeStored() {
String stackVersion = TEST_VERSION;
String stackType = "HDP";
when(blueprintStackInfo.getVersion()).thenReturn(stackVersion);
when(blueprintStackInfo.getType()).thenReturn(stackType);
BlueprintView expected = mock(BlueprintView.class);
when(blueprintViewProvider.getBlueprintView(blueprint)).thenReturn(expected);
TemplatePreparationObject result = underTest.convert(source);
assertSame(expected, result.getBlueprintView());
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class BlueprintViewProviderTest method testUsesProcessorFromFactory.
private void testUsesProcessorFromFactory(BlueprintTextProcessor processor) {
when(blueprintTextProcessorFactory.createBlueprintTextProcessor(TEST_BLUEPRINT_TEXT)).thenReturn(processor);
BlueprintView blueprintView = subject.getBlueprintView(blueprint);
assertEquals(TEST_BLUEPRINT_TEXT, blueprintView.getBlueprintText());
assertEquals(TEST_STACK_TYPE, blueprintView.getType());
assertEquals(TEST_STACK_VERSION, blueprintView.getVersion());
assertSame(processor, blueprintView.getProcessor());
}
use of com.sequenceiq.cloudbreak.template.views.BlueprintView in project cloudbreak by hortonworks.
the class HdfsRoleConfigProviderTest method nameNodeHA.
@Test
void nameNodeHA() {
HostgroupView gateway = new HostgroupView("gateway", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView master = new HostgroupView("master", 0, InstanceGroupType.CORE, 2);
HostgroupView quorum = new HostgroupView("quorum", 0, InstanceGroupType.CORE, 3);
HostgroupView worker = new HostgroupView("worker", 0, InstanceGroupType.CORE, 3);
String inputJson = FileReaderUtils.readFileFromClasspathQuietly("input/namenode-ha.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
TemplatePreparationObject preparationObject = TemplatePreparationObject.Builder.builder().withHostgroupViews(Set.of(gateway, master, quorum, worker)).withBlueprintView(new BlueprintView(inputJson, "CDP", "1.0", cmTemplateProcessor)).build();
Map<String, List<ApiClusterTemplateConfig>> roleConfigs = subject.getRoleConfigs(cmTemplateProcessor, preparationObject);
List<ApiClusterTemplateConfig> namenodeConfigs = roleConfigs.get("hdfs-NAMENODE-BASE");
Map<String, ApiClusterTemplateConfig> configMap = cmTemplateProcessor.mapByName(namenodeConfigs);
assertEquals(NN_HA_PROPERTIES, configMap.keySet());
assertEquals("true", configMap.get("autofailover_enabled").getValue());
}
Aggregations