use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.
the class CloudStorageParametersConverter method adlsParametersToFileSystem.
public AdlsFileSystem adlsParametersToFileSystem(AdlsCloudStorageV1Parameters source) {
AdlsFileSystem fileSystemConfigurations = new AdlsFileSystem();
fileSystemConfigurations.setClientId(source.getClientId());
fileSystemConfigurations.setAccountName(source.getAccountName());
fileSystemConfigurations.setCredential(source.getCredential());
fileSystemConfigurations.setTenantId(source.getTenantId());
return fileSystemConfigurations;
}
use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.
the class S3ConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(boolean useS3FileSystem, boolean fillDynamoTableName, boolean includeLocations) {
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.GATEWAY, 1);
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, 2);
List<StorageLocationView> locations = new ArrayList<>();
if (includeLocations) {
locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.dir", "s3a://bucket-first/warehouse/managed")));
locations.add(new StorageLocationView(getStorageLocation("hive.metastore.warehouse.external.dir", "s3a://bucket-first/warehouse/external")));
locations.add(new StorageLocationView(getStorageLocation("ranger_plugin_hdfs_audit_url", "s3a://bucket-second/ranger/audit")));
}
BaseFileSystemConfigurationsView fileSystemConfigurationsView;
if (useS3FileSystem) {
S3FileSystem s3FileSystem = new S3FileSystem();
if (fillDynamoTableName) {
s3FileSystem.setS3GuardDynamoTableName("dynamoTable");
}
fileSystemConfigurationsView = new S3FileSystemConfigurationsView(s3FileSystem, locations, false);
} else {
fileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(new AdlsFileSystem(), locations, false);
}
Gateway gateway = TestUtil.gatewayEnabledWithExposedKnoxServices("NAMENODE");
PlacementView placementView = new PlacementView("region", "az");
return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).withGateway(gateway, "/cb/secret/signkey", new HashSet<>()).withPlacementView(placementView).withDefaultTags(Map.of("apple", "apple1")).build();
}
use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.
the class TemplateCoreTestUtil method adlsFileSystem.
public static AdlsFileSystem adlsFileSystem() {
AdlsFileSystem adlsFileSystem = new AdlsFileSystem();
adlsFileSystem.setClientId("clientid");
adlsFileSystem.setAccountName("accountname");
adlsFileSystem.setCredential("1");
adlsFileSystem.setTenantId("tenantid");
return adlsFileSystem;
}
use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.
the class FileSystemConverter method legacyConvertFromConfiguration.
private List<CloudFileSystemView> legacyConvertFromConfiguration(FileSystem source) {
try {
CloudFileSystemView fileSystemView;
if (source.getType().isAdls()) {
AdlsFileSystem adlsFileSystem = source.getConfigurations().get(AdlsFileSystem.class);
fileSystemView = convertAdlsLegacy(adlsFileSystem);
} else if (source.getType().isGcs()) {
GcsFileSystem gcsFileSystem = source.getConfigurations().get(GcsFileSystem.class);
fileSystemView = convertGcsLegacy(gcsFileSystem);
} else if (source.getType().isS3()) {
S3FileSystem s3FileSystem = source.getConfigurations().get(S3FileSystem.class);
fileSystemView = convertS3Legacy(s3FileSystem);
} else if (source.getType().isEfs()) {
EfsFileSystem efsFileSystem = source.getConfigurations().get(EfsFileSystem.class);
fileSystemView = convertEfsLegacy(efsFileSystem);
} else if (source.getType().isWasb()) {
WasbFileSystem wasbFileSystem = source.getConfigurations().get(WasbFileSystem.class);
fileSystemView = convertWasbLegacy(wasbFileSystem);
} else if (source.getType().isAdlsGen2()) {
AdlsGen2FileSystem adlsGen2FileSystem = source.getConfigurations().get(AdlsGen2FileSystem.class);
fileSystemView = convertAdlsGen2Legacy(adlsGen2FileSystem);
} else if (source.getType().isGcs()) {
GcsFileSystem gcsFileSystem = source.getConfigurations().get(GcsFileSystem.class);
fileSystemView = convertGcsLegacy(gcsFileSystem);
} else {
return Collections.emptyList();
}
return List.of(fileSystemView);
} catch (IOException e) {
LOGGER.warn("Error occurred when tried to convert filesystem object: {}", e.getMessage());
}
return Collections.emptyList();
}
use of com.sequenceiq.common.api.filesystem.AdlsFileSystem in project cloudbreak by hortonworks.
the class CloudStorageParametersConverter method adlsToFileSystem.
public AdlsFileSystem adlsToFileSystem(AdlsCloudStorageV1Parameters source) {
AdlsFileSystem fileSystemConfigurations = new AdlsFileSystem();
fileSystemConfigurations.setClientId(source.getClientId());
fileSystemConfigurations.setAccountName(source.getAccountName());
fileSystemConfigurations.setCredential(source.getCredential());
fileSystemConfigurations.setTenantId(source.getTenantId());
return fileSystemConfigurations;
}
Aggregations