use of com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView in project cloudbreak by hortonworks.
the class DatalakeService method createSharedServiceConfigsView.
public SharedServiceConfigsView createSharedServiceConfigsView(Stack stack) {
SharedServiceConfigsView sharedServiceConfigsView = new SharedServiceConfigsView();
String password = stack.getCluster().getPassword();
switch(stack.getType()) {
case DATALAKE:
setRangerAttributes(password, sharedServiceConfigsView);
sharedServiceConfigsView.setDatalakeCluster(true);
break;
case WORKLOAD:
sharedServiceConfigsView.setRangerAdminPort(DEFAULT_RANGER_PORT);
sharedServiceConfigsView.setDatalakeCluster(false);
sharedServiceConfigsView.setAttachedCluster(true);
if (Strings.isNullOrEmpty(stack.getDatalakeCrn())) {
break;
}
Stack datalakeStack = stackService.getByCrnOrElseNull(stack.getDatalakeCrn());
if (datalakeStack == null) {
break;
}
sharedServiceConfigsView.setDatalakeClusterManagerFqdn(getDatalakeClusterManagerFqdn(datalakeStack));
sharedServiceConfigsView.setDatalakeClusterManagerIp(datalakeStack.getClusterManagerIp());
break;
default:
setRangerAttributes(password, sharedServiceConfigsView);
sharedServiceConfigsView.setDatalakeCluster(false);
break;
}
return sharedServiceConfigsView;
}
use of com.sequenceiq.cloudbreak.template.views.SharedServiceConfigsView 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();
}
Aggregations