use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView 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.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class AzureFileSystemConfigProvider method decorateFileSystemConfiguration.
public BaseFileSystemConfigurationsView decorateFileSystemConfiguration(String uuid, Json credentialAttributes, Resource resourceByType, BaseFileSystemConfigurationsView fsConfiguration) {
String resourceGroupName = resourceByType == null ? "" : resourceByType.getResourceName();
// we have to lookup secret key from the credential because it is not stored in client side
if (fsConfiguration instanceof AdlsFileSystemConfigurationsView) {
String adlsTrackingTag = (cbVersion != null) ? ADLS_TRACKING_CLUSTERNAME_VALUE + '-' + cbVersion : ADLS_TRACKING_CLUSTERNAME_VALUE;
AdlsFileSystemConfigurationsView fileSystemConfigurationsView = (AdlsFileSystemConfigurationsView) fsConfiguration;
if (StringUtils.isEmpty(fileSystemConfigurationsView.getClientId())) {
String credentialString = String.valueOf(credentialAttributes.getMap().get(CREDENTIAL_SECRET_KEY));
String clientId = String.valueOf(credentialAttributes.getMap().get(ACCESS_KEY));
fileSystemConfigurationsView.setCredential(credentialString);
fileSystemConfigurationsView.setClientId(clientId);
}
if (StringUtils.isEmpty(fileSystemConfigurationsView.getTenantId())) {
String tenantId = String.valueOf(credentialAttributes.getMap().get(TENANT_ID));
fileSystemConfigurationsView.setTenantId(tenantId);
}
fileSystemConfigurationsView.setAdlsTrackingClusterNameKey(uuid);
fileSystemConfigurationsView.setAdlsTrackingClusterTypeKey(adlsTrackingTag);
fileSystemConfigurationsView.setResourceGroupName(resourceGroupName);
} else if (fsConfiguration instanceof WasbFileSystemConfigurationsView) {
((WasbFileSystemConfigurationsView) fsConfiguration).setResourceGroupName(resourceGroupName);
}
return fsConfiguration;
}
use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testCreateResource.
@Test
public void testCreateResource() {
AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false);
Map<String, String> actual = underTest.createResources(adlsFileSystemConfigurationsView);
Assert.assertEquals(emptyMap(), actual);
}
use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class TemplateCoreTestUtil method adlsFileSystemConfiguration.
public static AdlsFileSystemConfigurationsView adlsFileSystemConfiguration(Collection<StorageLocationView> storageLocationViews) {
AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), storageLocationViews, false);
adlsFileSystemConfigurationsView.setAdlsTrackingClusterNameKey("normal-cluster");
adlsFileSystemConfigurationsView.setAdlsTrackingClusterTypeKey("normal-cluster-type");
adlsFileSystemConfigurationsView.setResourceGroupName("group");
return adlsFileSystemConfigurationsView;
}
use of com.sequenceiq.cloudbreak.template.filesystem.adls.AdlsFileSystemConfigurationsView in project cloudbreak by hortonworks.
the class AbstractFileSystemConfiguratorTest method testGetScriptsWhenNoReplace.
@Test
public void testGetScriptsWhenNoReplace() {
Credential credential = Credential.builder().crn("crn1").build();
AdlsFileSystemConfigurationsView adlsFileSystemConfigurationsView = new AdlsFileSystemConfigurationsView(adlsFileSystem(), new HashSet<>(), false);
List<RecipeScript> actual = underTest.getScripts(credential, adlsFileSystemConfigurationsView);
List<RecipeScript> expected = singletonList(new RecipeScript("echo '$replace'", ExecutionType.ALL_NODES, RecipeType.POST_CLOUDERA_MANAGER_START));
Assert.assertEquals(expected, actual);
}
Aggregations