use of com.sequenceiq.cloudbreak.api.model.FileSystemType in project cloudbreak by hortonworks.
the class FileSystemConfigurationProvider method fileSystemConfiguration.
public FileSystemConfiguration fileSystemConfiguration(FileSystem fs, Stack stack) throws IOException {
FileSystemConfiguration fileSystemConfiguration = null;
if (fs != null) {
FileSystemType fileSystemType = FileSystemType.valueOf(fs.getType());
String json = JsonUtil.writeValueAsString(fs.getProperties());
fileSystemConfiguration = JsonUtil.readValue(json, fileSystemType.getClazz());
if (stack != null) {
fileSystemConfiguration = decorateFsConfigurationProperties(fileSystemConfiguration, stack);
}
}
return fileSystemConfiguration;
}
use of com.sequenceiq.cloudbreak.api.model.FileSystemType in project cloudbreak by hortonworks.
the class BlueprintComponentProviderProcessor method extendBlueprintWithFsConfig.
private String extendBlueprintWithFsConfig(BlueprintTextProcessor blueprintProcessor, FileSystemConfiguration fsConfiguration, boolean defaultFs) {
FileSystemType fileSystemType = FileSystemType.fromClass(fsConfiguration.getClass());
FileSystemConfigurator<FileSystemConfiguration> fsConfigurator = fileSystemConfigurators.get(fileSystemType);
Map<String, String> resourceProperties = fsConfigurator.createResources(fsConfiguration);
List<BlueprintConfigurationEntry> bpConfigEntries = fsConfigurator.getFsProperties(fsConfiguration, resourceProperties);
if (defaultFs) {
bpConfigEntries.addAll(fsConfigurator.getDefaultFsProperties(fsConfiguration));
}
return blueprintProcessor.addConfigEntries(bpConfigEntries, true).asText();
}
Aggregations