Search in sources :

Example 1 with GcsFileSystem

use of com.sequenceiq.common.api.filesystem.GcsFileSystem in project cloudbreak by hortonworks.

the class GcsFileSystemToGcsCloudStorageParametersConverterTest method createGcsFileSystem.

private GcsFileSystem createGcsFileSystem() {
    GcsFileSystem gcs = new GcsFileSystem();
    gcs.setServiceAccountEmail(TEST_SERVICE_ACCOUNT_EMAIL);
    return gcs;
}
Also used : GcsFileSystem(com.sequenceiq.common.api.filesystem.GcsFileSystem)

Example 2 with GcsFileSystem

use of com.sequenceiq.common.api.filesystem.GcsFileSystem 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();
}
Also used : GcsFileSystem(com.sequenceiq.common.api.filesystem.GcsFileSystem) AdlsGen2FileSystem(com.sequenceiq.common.api.filesystem.AdlsGen2FileSystem) CloudFileSystemView(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView) IOException(java.io.IOException) EfsFileSystem(com.sequenceiq.common.api.filesystem.EfsFileSystem) AdlsFileSystem(com.sequenceiq.common.api.filesystem.AdlsFileSystem) WasbFileSystem(com.sequenceiq.common.api.filesystem.WasbFileSystem) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem)

Example 3 with GcsFileSystem

use of com.sequenceiq.common.api.filesystem.GcsFileSystem in project cloudbreak by hortonworks.

the class CloudStorageParametersConverter method gcsToFileSystem.

public GcsFileSystem gcsToFileSystem(GcsCloudStorageV1Parameters source) {
    GcsFileSystem fileSystemConfigurations = new GcsFileSystem();
    fileSystemConfigurations.setServiceAccountEmail(source.getServiceAccountEmail());
    return fileSystemConfigurations;
}
Also used : GcsFileSystem(com.sequenceiq.common.api.filesystem.GcsFileSystem)

Example 4 with GcsFileSystem

use of com.sequenceiq.common.api.filesystem.GcsFileSystem in project cloudbreak by hortonworks.

the class ZeppelinCloudStorageRoleConfigProviderTest method assertZeppelinStorageValues.

protected void assertZeppelinStorageValues(String storagePath) {
    List<StorageLocationView> locations = new ArrayList<>();
    StorageLocation zeppelinNotebookDir = new StorageLocation();
    zeppelinNotebookDir.setProperty("zeppelin.notebook.dir");
    zeppelinNotebookDir.setValue(storagePath);
    locations.add(new StorageLocationView(zeppelinNotebookDir));
    BaseFileSystemConfigurationsView fileSystemConfigurationsView;
    if (storagePath.startsWith("s3a")) {
        fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
    } else if (storagePath.startsWith("gcs")) {
        fileSystemConfigurationsView = new GcsFileSystemConfigurationsView(new GcsFileSystem(), locations, false);
    } else {
        fileSystemConfigurationsView = new AdlsGen2FileSystemConfigurationsView(new AdlsGen2FileSystem(), locations, false);
    }
    TemplatePreparationObject preparationObject = getTemplatePreparationObject(fileSystemConfigurationsView);
    String inputJson = getBlueprintText("input/clouderamanager-ds.bp");
    CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
    Map<String, List<ApiClusterTemplateConfig>> roleConfigs = underTest.getRoleConfigs(cmTemplateProcessor, preparationObject);
    List<ApiClusterTemplateConfig> zeppelinStorageConfigs = roleConfigs.get("zeppelin-ZEPPELIN_SERVER-BASE");
    assertEquals(1, zeppelinStorageConfigs.size());
    assertEquals("zeppelin.notebook.dir", zeppelinStorageConfigs.get(0).getName());
    assertEquals(storagePath, zeppelinStorageConfigs.get(0).getValue());
}
Also used : GcsFileSystem(com.sequenceiq.common.api.filesystem.GcsFileSystem) StorageLocationView(com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView) BaseFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView) AdlsGen2FileSystem(com.sequenceiq.common.api.filesystem.AdlsGen2FileSystem) ArrayList(java.util.ArrayList) ApiClusterTemplateConfig(com.cloudera.api.swagger.model.ApiClusterTemplateConfig) S3FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView) S3FileSystem(com.sequenceiq.common.api.filesystem.S3FileSystem) TemplatePreparationObject(com.sequenceiq.cloudbreak.template.TemplatePreparationObject) AdlsGen2FileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.adlsgen2.AdlsGen2FileSystemConfigurationsView) GcsFileSystemConfigurationsView(com.sequenceiq.cloudbreak.template.filesystem.gcs.GcsFileSystemConfigurationsView) ArrayList(java.util.ArrayList) List(java.util.List) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation)

Example 5 with GcsFileSystem

use of com.sequenceiq.common.api.filesystem.GcsFileSystem in project cloudbreak by hortonworks.

the class TemplateCoreTestUtil method gcsFileSystem.

public static GcsFileSystem gcsFileSystem() {
    GcsFileSystem gcsFileSystem = new GcsFileSystem();
    gcsFileSystem.setServiceAccountEmail("serviceaccountemail");
    return gcsFileSystem;
}
Also used : GcsFileSystem(com.sequenceiq.common.api.filesystem.GcsFileSystem)

Aggregations

GcsFileSystem (com.sequenceiq.common.api.filesystem.GcsFileSystem)5 AdlsGen2FileSystem (com.sequenceiq.common.api.filesystem.AdlsGen2FileSystem)2 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)2 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)1 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)1 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)1 StorageLocation (com.sequenceiq.cloudbreak.domain.StorageLocation)1 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)1 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)1 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)1 AdlsGen2FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.adlsgen2.AdlsGen2FileSystemConfigurationsView)1 GcsFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.gcs.GcsFileSystemConfigurationsView)1 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)1 AdlsFileSystem (com.sequenceiq.common.api.filesystem.AdlsFileSystem)1 EfsFileSystem (com.sequenceiq.common.api.filesystem.EfsFileSystem)1 WasbFileSystem (com.sequenceiq.common.api.filesystem.WasbFileSystem)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1