use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.
the class FlinkCloudStorageConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(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(getStorageLocationView(HISTORY_SERVER_ARCHIVE_FS_DIR_NAME, HISTORY_SERVER_ARCHIVE_FS_DIR_VALUE));
locations.add(getStorageLocationView(JOBMANAGER_ARCHIVE_FS_DIR_NAME, JOBMANAGER_ARCHIVE_FS_DIR_VALUE));
locations.add(getStorageLocationView(STATE_CHECKPOINTS_DIR_NAME, STATE_CHECKPOINTS_DIR_VALUE));
locations.add(getStorageLocationView(STATE_SAVEPOINTS_DIR_NAME, STATE_SAVEPOINTS_DIR_VALUE));
locations.add(getStorageLocationView(HIGH_AVAILABILITY_STORAGE_DIR_NAME, HIGH_AVAILABILITY_STORAGE_DIR_VALUE));
}
S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).build();
}
use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.
the class FlinkCloudStorageConfigProviderTest method getStorageLocationView.
private StorageLocationView getStorageLocationView(String property, String value) {
StorageLocation storageLocation = new StorageLocation();
storageLocation.setProperty(property);
storageLocation.setValue(value);
return new StorageLocationView(storageLocation);
}
use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.
the class AbstractHbaseConfigProviderTest method getTemplatePreparationObject.
protected TemplatePreparationObject getTemplatePreparationObject(boolean includeLocations, boolean datalakeCluster, String cdhVersion, Map<String, String> defaultTags, CloudPlatform cloudPlatform) {
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) {
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);
SharedServiceConfigsView sharedServicesConfigsView = new SharedServiceConfigsView();
sharedServicesConfigsView.setDatalakeCluster(datalakeCluster);
String inputJson = getBlueprintText("input/clouderamanager.bp");
CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson);
cmTemplateProcessor.setCdhVersion(cdhVersion);
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setAccountId(Optional.of("1234"));
return TemplatePreparationObject.Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withBlueprintView(new BlueprintView(inputJson, "", "", cmTemplateProcessor)).withSharedServiceConfigs(sharedServicesConfigsView).withHostgroupViews(Set.of(master, worker)).withGeneralClusterConfigs(generalClusterConfigs).withDefaultTags(defaultTags).withCloudPlatform(cloudPlatform).build();
}
use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.
the class ProfilerSchedulerCloudStorageRoleConfigProviderTest method getTemplatePreparationObject.
private TemplatePreparationObject getTemplatePreparationObject(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(getProfilerSchedulerFileSystemUri()));
}
S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(master, worker)).build();
}
use of com.sequenceiq.cloudbreak.template.filesystem.StorageLocationView in project cloudbreak by hortonworks.
the class RangerCloudStorageServiceConfigProviderTest method getTemplatePreparationObjectForAws.
private TemplatePreparationObject.Builder getTemplatePreparationObjectForAws(boolean includeLocations, boolean above721, boolean includeBackup) {
HostgroupView gateway = new HostgroupView("gateway", 1, InstanceGroupType.GATEWAY, Set.of("g"));
HostgroupView master = new HostgroupView("master", 1, InstanceGroupType.CORE, Set.of("m1", "m2"));
HostgroupView worker = new HostgroupView("worker", 2, InstanceGroupType.CORE, Set.of("w1", "w2", "w3"));
List<StorageLocationView> locations = new ArrayList<>();
if (includeLocations) {
locations.add(new StorageLocationView(getRangerAuditCloudStorageDirAws()));
if (above721) {
locations.add(new StorageLocationView(buildStorageLocation("hive.metastore.warehouse.dir", "s3a://bucket/warehouse/tablespace/managed/hive")));
locations.add(new StorageLocationView(buildStorageLocation("hive.repl.replica.functions.root.dir", "s3a://bucket/hive_replica_functions_dir")));
locations.add(new StorageLocationView(buildStorageLocation("hive.metastore.warehouse.external.dir", "s3a://bucket/warehouse/tablespace/external/hive")));
locations.add(new StorageLocationView(buildStorageLocation("hbase.rootdir", "s3a://bucket/hbase")));
if (includeBackup) {
locations.add(new StorageLocationView(buildStorageLocation(DEFAULT_BACKUP_DIR, "s3a://bucket/backup/location")));
}
}
}
S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false);
GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs();
generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("fqdn"));
return Builder.builder().withFileSystemConfigurationView(fileSystemConfigurationsView).withHostgroupViews(Set.of(gateway, master, worker)).withGeneralClusterConfigs(generalClusterConfigs);
}
Aggregations