use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.
the class BlueprintTemplateModelContextBuilder method withRdsConfigs.
public BlueprintTemplateModelContextBuilder withRdsConfigs(Iterable<RDSConfig> rdsConfigs) {
for (RDSConfig rdsConfig : rdsConfigs) {
if (rdsConfig != null) {
RdsView rdsView = new RdsView(rdsConfig);
String componentName = rdsConfig.getType().toLowerCase();
this.rds.put(componentName, rdsView);
}
}
return this;
}
use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.
the class BlueprintTemplateProcessorTest method rdsConfig.
private RDSConfig rdsConfig(String rdsType) {
RDSConfig rdsConfig = new RDSConfig();
rdsConfig.setName(rdsType);
rdsConfig.setConnectionPassword("iamsoosecure");
rdsConfig.setConnectionUserName("heyitsme");
rdsConfig.setConnectionURL("jdbc:postgresql://10.1.1.1:5432/" + rdsType);
rdsConfig.setConnectionDriver("org.postgresql.Driver");
rdsConfig.setDatabaseEngine("POSTGRES");
rdsConfig.setType(rdsType);
return rdsConfig;
}
use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.
the class BlueprintTemplateProcessorTest method cluster.
private Cluster cluster() {
Cluster cluster = TestUtil.cluster();
Set<RDSConfig> rdsConfigSet = new HashSet<>();
rdsConfigSet.add(rdsConfig(RdsType.DRUID.name().toLowerCase()));
RDSConfig hiveRds = rdsConfig(RdsType.HIVE.name().toLowerCase());
rdsConfigSet.add(hiveRds);
rdsConfigSet.add(rdsConfig(RdsType.RANGER.name().toLowerCase()));
cluster.setRdsConfigs(rdsConfigSet);
Map<String, String> inputs = new HashMap<>();
inputs.put("S3_BUCKET", "testbucket");
try {
cluster.setBlueprintInputs(new Json(inputs));
} catch (JsonProcessingException ignored) {
cluster.setBlueprintInputs(null);
}
return cluster;
}
use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.
the class RdsViewTest method testCreateRdsViewWhenConnectionUrlContainsSubprotocolAndSubname.
@Test
public void testCreateRdsViewWhenConnectionUrlContainsSubprotocolAndSubname() {
String connectionUrl = "jdbc:postgresql:subname://some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432/ranger";
RDSConfig rdsConfig = createRdsConfig(connectionUrl);
RdsView underTest = new RdsView(rdsConfig);
Assert.assertEquals(ASSERT_ERROR_MSG, "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432", underTest.getHostWithPort());
Assert.assertEquals("postgresql:subname", underTest.getSubprotocol());
}
use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.
the class RdsViewTest method testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutDatabaseName.
@Test
public void testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutDatabaseName() {
String connectionUrl = "jdbc:postgresql://some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432";
RDSConfig rdsConfig = createRdsConfig(connectionUrl);
RdsView underTest = new RdsView(rdsConfig);
Assert.assertEquals(ASSERT_ERROR_MSG, "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432", underTest.getHostWithPort());
}
Aggregations