Search in sources :

Example 1 with GcsFileSystemConfigurationsView

use of com.sequenceiq.cloudbreak.template.filesystem.gcs.GcsFileSystemConfigurationsView 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)

Aggregations

ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)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 AdlsGen2FileSystem (com.sequenceiq.common.api.filesystem.AdlsGen2FileSystem)1 GcsFileSystem (com.sequenceiq.common.api.filesystem.GcsFileSystem)1 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1