use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class BlueprintTextProcessorTest method addToBlueprint.
@Test
public void addToBlueprint() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/test-bp-zeppelin-shiro.bp");
List<BlueprintConfigurationEntry> configs = new ArrayList<>();
configs.add(new BlueprintConfigurationEntry("zeppelin-env", "shiro_ini_content", "changed"));
String result = underTest.get(testBlueprint).addConfigEntries(configs, false).asText();
Assert.assertEquals(testBlueprint.replaceAll("\\s", ""), result);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class BlueprintTextProcessorTest method addSettingsToBlueprintWhenSettingsBlockExists.
@Test
public void addSettingsToBlueprintWhenSettingsBlockExists() throws Exception {
String testBlueprint = FileReaderUtils.readFileFromClasspath("blueprints-jackson/bp-with-settings-array.bp");
String res = FileReaderUtils.readFileFromClasspath("blueprints-jackson/with-settings-bp-result.bp");
List<BlueprintConfigurationEntry> configs = new ArrayList<>();
configs.add(new BlueprintConfigurationEntry("recovery_settings", "recovery_enabled", "true"));
configs.add(new BlueprintConfigurationEntry("cluster-env", "recovery_enabled", "true"));
configs.add(new BlueprintConfigurationEntry("cluster-env", "recovery_type", "AUTO_START"));
String result = underTest.get(testBlueprint).addSettingsEntries(configs, false).asText();
Assert.assertEquals(res.replaceAll("\\s", ""), result.replaceAll("\\s", ""));
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class GcsFileSystemConfiguratorTest method testGetFsProperties.
@Test
public void testGetFsProperties() {
GcsFileSystemConfiguration fsConfig = new GcsFileSystemConfiguration();
List<BlueprintConfigurationEntry> actual = underTest.getFsProperties(fsConfig, emptyMap());
List<BlueprintConfigurationEntry> expected = Arrays.asList(new BlueprintConfigurationEntry("core-site", "fs.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem"), new BlueprintConfigurationEntry("core-site", "fs.AbstractFileSystem.gs.impl", "com.google.cloud.hadoop.fs.gcs.GoogleHadoopFS"), new BlueprintConfigurationEntry("core-site", "fs.gs.working.dir", "/"), new BlueprintConfigurationEntry("core-site", "fs.gs.system.bucket", fsConfig.getDefaultBucketName()), new BlueprintConfigurationEntry("core-site", "fs.gs.auth.service.account.enable", "true"), new BlueprintConfigurationEntry("core-site", "fs.gs.auth.service.account.keyfile", "/usr/lib/hadoop/lib/gcp.p12"), new BlueprintConfigurationEntry("core-site", "fs.gs.auth.service.account.email", fsConfig.getServiceAccountEmail()), new BlueprintConfigurationEntry("core-site", "fs.gs.project.id", fsConfig.getProjectId()));
Assert.assertEquals(expected, actual);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class WasbFileSystemConfiguratorTest method testGetFsProperties.
@Test
public void testGetFsProperties() {
WasbFileSystemConfiguration config = new WasbFileSystemConfiguration();
config.setAccountName("accountName");
config.setAccountKey("accountKey");
List<BlueprintConfigurationEntry> actual = underTest.getFsProperties(config, null);
List<BlueprintConfigurationEntry> expected = Arrays.asList(new BlueprintConfigurationEntry("core-site", "fs.AbstractFileSystem.wasbs.impl", "org.apache.hadoop.fs.azure.Wasbs"), new BlueprintConfigurationEntry("core-site", "fs.AbstractFileSystem.wasb.impl", "org.apache.hadoop.fs.azure.Wasb"), new BlueprintConfigurationEntry("core-site", "fs.azure.account.key.accountName.blob.core.windows.net", "accountKey"), new BlueprintConfigurationEntry("core-site", "fs.azure.selfthrottling.read.factor", "1.0"), new BlueprintConfigurationEntry("core-site", "fs.azure.selfthrottling.write.factor", "1.0"));
Assert.assertEquals(expected, actual);
}
use of com.sequenceiq.cloudbreak.blueprint.BlueprintConfigurationEntry in project cloudbreak by hortonworks.
the class WasbFileSystemConfigurator method getFsProperties.
@Override
public List<BlueprintConfigurationEntry> getFsProperties(WasbFileSystemConfiguration fsConfig, Map<String, String> resourceProperties) {
List<BlueprintConfigurationEntry> bpConfigs = new ArrayList<>();
String accountName = fsConfig.getAccountName();
String accountKey = fsConfig.getAccountKey();
bpConfigs.add(new BlueprintConfigurationEntry("core-site", "fs.AbstractFileSystem.wasbs.impl", "org.apache.hadoop.fs.azure.Wasbs"));
bpConfigs.add(new BlueprintConfigurationEntry("core-site", "fs.AbstractFileSystem.wasb.impl", "org.apache.hadoop.fs.azure.Wasb"));
bpConfigs.add(new BlueprintConfigurationEntry("core-site", "fs.azure.account.key." + accountName + ".blob.core.windows.net", accountKey));
bpConfigs.add(new BlueprintConfigurationEntry("core-site", "fs.azure.selfthrottling.read.factor", "1.0"));
bpConfigs.add(new BlueprintConfigurationEntry("core-site", "fs.azure.selfthrottling.write.factor", "1.0"));
return bpConfigs;
}
Aggregations