Search in sources :

Example 26 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation 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 27 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.

the class TemplateCoreTestUtil method storageLocationViewsWithDuplicatedKey.

public static List<StorageLocationView> storageLocationViewsWithDuplicatedKey() {
    List<StorageLocationView> storageLocations = new ArrayList<>();
    storageLocations.add(storageLocationView(storageLocation(0)));
    StorageLocation storageLocation = storageLocation(1);
    storageLocation.setConfigFile("0_file");
    storageLocations.add(storageLocationView(storageLocation));
    return storageLocations;
}
Also used : ArrayList(java.util.ArrayList) StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation)

Example 28 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.

the class TemplateCoreTestUtil method storageLocation.

public static StorageLocation storageLocation(int i) {
    StorageLocation storageLocation = new StorageLocation();
    storageLocation.setValue(i + "_test/test/end");
    storageLocation.setProperty(i + "_property");
    storageLocation.setConfigFile(i + "_file");
    return storageLocation;
}
Also used : StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation)

Example 29 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.

the class HiveMetastoreCloudStorageServiceConfigProviderTest method getHiveWarehouseStorageLocation.

protected StorageLocation getHiveWarehouseStorageLocation() {
    StorageLocation hmsWarehouseDir = new StorageLocation();
    hmsWarehouseDir.setProperty("hive.metastore.warehouse.dir");
    hmsWarehouseDir.setValue("s3a://bucket/hive/warehouse");
    return hmsWarehouseDir;
}
Also used : StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation)

Example 30 with StorageLocation

use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.

the class HiveMetastoreCloudStorageServiceConfigProviderTest method getHiveWarehouseExternalStorageLocation.

protected StorageLocation getHiveWarehouseExternalStorageLocation() {
    StorageLocation hmsExternalWarehouseDir = new StorageLocation();
    hmsExternalWarehouseDir.setProperty("hive.metastore.warehouse.external.dir");
    hmsExternalWarehouseDir.setValue("s3a://bucket/hive/warehouse/external");
    return hmsExternalWarehouseDir;
}
Also used : StorageLocation(com.sequenceiq.cloudbreak.domain.StorageLocation)

Aggregations

StorageLocation (com.sequenceiq.cloudbreak.domain.StorageLocation)40 StorageLocationView (com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView)16 ArrayList (java.util.ArrayList)13 S3FileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.s3.S3FileSystemConfigurationsView)11 S3FileSystem (com.sequenceiq.common.api.filesystem.S3FileSystem)11 HostgroupView (com.sequenceiq.cloudbreak.template.views.HostgroupView)7 Test (org.junit.Test)6 TemplatePreparationObject (com.sequenceiq.cloudbreak.template.TemplatePreparationObject)5 BaseFileSystemConfigurationsView (com.sequenceiq.cloudbreak.template.filesystem.BaseFileSystemConfigurationsView)5 CmTemplateProcessor (com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor)4 ApiClusterTemplate (com.cloudera.api.swagger.model.ApiClusterTemplate)2 BackupResponse (com.sequenceiq.common.api.backup.response.BackupResponse)2 HashSet (java.util.HashSet)2 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)2 ApiClusterTemplateConfig (com.cloudera.api.swagger.model.ApiClusterTemplateConfig)1 ClouderaManagerRepo (com.sequenceiq.cloudbreak.cloud.model.ClouderaManagerRepo)1 CoreConfigProvider (com.sequenceiq.cloudbreak.cmtemplate.configproviders.core.CoreConfigProvider)1 HiveMetastoreConfigProvider (com.sequenceiq.cloudbreak.cmtemplate.configproviders.hive.HiveMetastoreConfigProvider)1 Json (com.sequenceiq.cloudbreak.common.json.Json)1 FileSystem (com.sequenceiq.cloudbreak.domain.FileSystem)1