Source:
private TemplatePreparationObject.Builder getTemplatePreparationObjectForAws(boolean includeLocations, boolean above721) { 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"))); } } S3FileSystemConfigurationsView fileSystemConfigurationsView = new S3FileSystemConfigurationsView(new S3FileSystem(), locations, false); GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs(); generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("fqdn")); SharedServiceConfigsView sharedServicesConfigsView = new SharedServiceConfigsView(); sharedServicesConfigsView.setDatalakeCluster(true); return Builder.builder() .withFileSystemConfigurationView(fileSystemConfigurationsView) .withHostgroupViews(Set.of(gateway, master, worker)) .withSharedServiceConfigs(sharedServicesConfigsView) .withGeneralClusterConfigs(generalClusterConfigs); }

Target:
private TemplatePreparationObject.Builder getTemplatePreparationObjectForAws(boolean includeLocations, boolean above721) { 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"))); } } 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); }