use of com.sequenceiq.cloudbreak.api.model.FileSystemConfiguration in project cloudbreak by hortonworks.
the class FileSystemViewTest method testGcsFileSystemConfiguration.
@Test
public void testGcsFileSystemConfiguration() {
FileSystemConfiguration fileSystemConfiguration = TestUtil.gcsFileSystemConfiguration();
FileSystemView fileSystemView = new FileSystemView(fileSystemConfiguration);
Assert.assertNotNull(fileSystemView);
Assert.assertEquals(3, fileSystemView.getProperties().size());
}
use of com.sequenceiq.cloudbreak.api.model.FileSystemConfiguration in project cloudbreak by hortonworks.
the class FileSystemViewTest method testWasbIntegratedFileSystemConfiguration.
@Test
public void testWasbIntegratedFileSystemConfiguration() {
FileSystemConfiguration fileSystemConfiguration = TestUtil.wasbIntegratedFileSystemConfiguration();
FileSystemView fileSystemView = new FileSystemView(fileSystemConfiguration);
Assert.assertNotNull(fileSystemView);
Assert.assertEquals(6, fileSystemView.getProperties().size());
}
use of com.sequenceiq.cloudbreak.api.model.FileSystemConfiguration in project cloudbreak by hortonworks.
the class StackRequestToBlueprintPreparationObjectConverter method getFileSystemConfigurationView.
private FileSystemConfigurationView getFileSystemConfigurationView(StackV2Request source) throws IOException {
FileSystemConfigurationView fileSystemConfigurationView = null;
if (source.getCluster().getFileSystem() != null) {
FileSystem fileSystem = getConversionService().convert(source.getCluster().getFileSystem(), FileSystem.class);
FileSystemConfiguration fileSystemConfiguration = fileSystemConfigurationProvider.fileSystemConfiguration(fileSystem, null);
fileSystemConfigurationView = new FileSystemConfigurationView(fileSystemConfiguration, source.getCluster().getFileSystem().isDefaultFs());
}
return fileSystemConfigurationView;
}
use of com.sequenceiq.cloudbreak.api.model.FileSystemConfiguration in project cloudbreak by hortonworks.
the class ClusterTerminationService method deleteFileSystemResources.
private void deleteFileSystemResources(Long stackId, FileSystem fileSystem) {
try {
FileSystemConfigurator fsConfigurator = fileSystemConfigurators.get(FileSystemType.valueOf(fileSystem.getType()));
String json = writeValueAsString(fileSystem.getProperties());
FileSystemConfiguration fsConfiguration = readValue(json, FileSystemType.valueOf(fileSystem.getType()).getClazz());
fsConfiguration.addProperty(FileSystemConfiguration.STORAGE_CONTAINER, "cloudbreak" + stackId);
fsConfigurator.deleteResources(fsConfiguration);
} catch (IOException e) {
throw new TerminationFailedException("File system resources could not be deleted: ", e);
}
}
use of com.sequenceiq.cloudbreak.api.model.FileSystemConfiguration in project cloudbreak by hortonworks.
the class RecipeEngine method addFsRecipesToHostGroups.
private void addFsRecipesToHostGroups(Credential credential, Iterable<HostGroup> hostGroups, String blueprintText, FileSystem fs) throws IOException {
String scriptName = fs.getType().toLowerCase();
FileSystemConfigurator fsConfigurator = fileSystemConfigurators.get(FileSystemType.valueOf(fs.getType()));
FileSystemConfiguration fsConfiguration = getFileSystemConfiguration(fs);
List<RecipeScript> recipeScripts = fsConfigurator.getScripts(credential, fsConfiguration);
List<Recipe> fsRecipes = recipeBuilder.buildRecipes(scriptName, recipeScripts);
for (int i = 0; i < fsRecipes.size(); i++) {
RecipeScript recipeScript = recipeScripts.get(i);
Recipe recipe = fsRecipes.get(i);
for (HostGroup hostGroup : hostGroups) {
if (ExecutionType.ALL_NODES == recipeScript.getExecutionType()) {
hostGroup.addRecipe(recipe);
} else if (ExecutionType.ONE_NODE == recipeScript.getExecutionType() && isComponentPresent(blueprintText, "NAMENODE", hostGroup)) {
hostGroup.addRecipe(recipe);
break;
}
}
}
}
Aggregations