use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.
the class RangerCloudStorageServiceConfigProviderTest method getRangerAuditCloudStorageDirAws.
protected StorageLocation getRangerAuditCloudStorageDirAws() {
StorageLocation rangerAuditLogLocation = new StorageLocation();
rangerAuditLogLocation.setProperty("ranger_plugin_hdfs_audit_url");
rangerAuditLogLocation.setValue("s3a://bucket/ranger/audit");
return rangerAuditLogLocation;
}
use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.
the class RangerCloudStorageServiceConfigProviderTest method getRangerAuditCloudStorageDirAzure.
protected StorageLocation getRangerAuditCloudStorageDirAzure() {
StorageLocation rangerAuditLogLocation = new StorageLocation();
rangerAuditLogLocation.setProperty("ranger_plugin_hdfs_audit_url");
rangerAuditLogLocation.setValue("abfs://data@your-san.dfs.core.windows.net/ranger/audit");
return rangerAuditLogLocation;
}
use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.
the class CentralCmTemplateUpdaterTest method getCmTemplateIfCoresettingspresentedShouldNotOverrideThePropertyWithEmptyString.
@Test
public void getCmTemplateIfCoresettingspresentedShouldNotOverrideThePropertyWithEmptyString() {
List<StorageLocationView> locations = new ArrayList<>();
StorageLocation hbaseRootDir = new StorageLocation();
hbaseRootDir.setProperty("hbase.rootdir");
hbaseRootDir.setValue("s3a://bucket/cluster1/hbase");
locations.add(new StorageLocationView(hbaseRootDir));
StorageLocation coresettings = new StorageLocation();
coresettings.setProperty("core_defaultfs");
coresettings.setValue("s3a://bucket/cluster1/hbase");
locations.add(new StorageLocationView(coresettings));
S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
when(templatePreparationObject.getFileSystemConfigurationView()).thenReturn(Optional.of(fileSystemConfigurationsView));
when(blueprintView.getBlueprintText()).thenReturn(getBlueprintText("input/core-settings-empty.bp"));
ApiClusterTemplate generated = testGetCmTemplate();
assertMatchesBlueprintAtPath("output/core-settings-empty.bp", generated);
}
use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.
the class CentralCmTemplateUpdaterTest method setUp.
@Before
public void setUp() {
when(entitlementService.sdxHbaseCloudStorageEnabled(anyString())).thenReturn(true);
List<CmTemplateComponentConfigProvider> cmTemplateComponentConfigProviders = List.of(new HiveMetastoreConfigProvider(), coreConfigProvider, hbaseCloudStorageProvider);
when(cmTemplateProcessorFactory.get(anyString())).thenAnswer(i -> new CmTemplateProcessor(i.getArgument(0)));
when(templatePreparationObject.getBlueprintView()).thenReturn(blueprintView);
when(templatePreparationObject.getHostgroupViews()).thenReturn(toHostgroupViews(getHostgroupMappings()));
when(templatePreparationObject.getGeneralClusterConfigs()).thenReturn(generalClusterConfigs);
doNothing().when(s3ConfigProvider).getServiceConfigs(any(TemplatePreparationObject.class), any(StringBuilder.class));
RDSConfig rdsConfig = TestUtil.rdsConfig(DatabaseType.HIVE);
when(templatePreparationObject.getRdsConfigs()).thenReturn(Set.of(rdsConfig));
when(templatePreparationObject.getRdsConfig(DatabaseType.HIVE)).thenReturn(rdsConfig);
when(templatePreparationObject.getCustomConfigurationsView()).thenReturn(Optional.of(customConfigurationsView));
List<StorageLocationView> locations = new ArrayList<>();
StorageLocation hbaseRootDir = new StorageLocation();
hbaseRootDir.setProperty("hbase.rootdir");
hbaseRootDir.setValue("s3a://bucket/cluster1/hbase");
locations.add(new StorageLocationView(hbaseRootDir));
S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
when(templatePreparationObject.getFileSystemConfigurationView()).thenReturn(Optional.of(fileSystemConfigurationsView));
when(generalClusterConfigs.getClusterName()).thenReturn("testcluster");
when(generalClusterConfigs.getPassword()).thenReturn("Admin123!");
when(generalClusterConfigs.getAccountId()).thenReturn(Optional.of("1234"));
clouderaManagerRepo = new ClouderaManagerRepo();
clouderaManagerRepo.setVersion("6.1.0");
ProductDetailsView productDetailsView = new ProductDetailsView(clouderaManagerRepo, List.of());
when(templatePreparationObject.getProductDetailsView()).thenReturn(productDetailsView);
ReflectionTestUtils.setField(cmTemplateComponentConfigProviderProcessor, "providers", cmTemplateComponentConfigProviders);
ReflectionTestUtils.setField(cmTemplateConfigInjectorProcessor, "injectors", List.of());
ReflectionTestUtils.setField(cmHostGroupRoleConfigProviderProcessor, "providers", List.of());
}
use of com.sequenceiq.cloudbreak.domain.StorageLocation in project cloudbreak by hortonworks.
the class CentralCmTemplateUpdaterTest method getCmTemplateIfCoresettingspresentedShouldNotOverrideTheProperty.
@Test
public void getCmTemplateIfCoresettingspresentedShouldNotOverrideTheProperty() {
List<StorageLocationView> locations = new ArrayList<>();
StorageLocation hbaseRootDir = new StorageLocation();
hbaseRootDir.setProperty("hbase.rootdir");
hbaseRootDir.setValue("s3a://bucket/cluster1/hbase");
locations.add(new StorageLocationView(hbaseRootDir));
StorageLocation coresettings = new StorageLocation();
coresettings.setProperty("core_defaultfs");
coresettings.setValue("s3a://bucket/cluster1/hbase");
locations.add(new StorageLocationView(coresettings));
S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
when(templatePreparationObject.getFileSystemConfigurationView()).thenReturn(Optional.of(fileSystemConfigurationsView));
when(blueprintView.getBlueprintText()).thenReturn(getBlueprintText("input/core-settings.bp"));
ApiClusterTemplate generated = testGetCmTemplate();
assertMatchesBlueprintAtPath("output/core-settings.bp", generated);
}
Aggregations