@Test public void testUpdateStorageLocationAdlsGen2() { Backup backup = createBackup(); backup.setS3(null); backup.setAdlsGen2(new AdlsGen2CloudStorageV1Parameters()); backup.setStorageLocation("abfs: underTest.updateStorageLocation(backup, FluentClusterType.FREEIPA.value(), "mycluster", "crn:cdp:cloudbreak:us-west-1:someone:stack:12345"); assertEquals("https: }
public Backup updateStorageLocation(Backup backup, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching backup storage locations with cluster data."); if (backup != null && StringUtils.isNotEmpty(backup.getStorageLocation())) { String storageLocation = backup.getStorageLocation(); if (backup.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (backup.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the backup storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } backup.setStorageLocation(storageLocation); } else { LOGGER.debug("Backup is not set, skipping cloud storage location updates."); } return backup; }
CloudBackupFolderResolverService { public Backup updateStorageLocation(Backup backup, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching backup storage locations with cluster data."); if (backup != null && StringUtils.isNotEmpty(backup.getStorageLocation())) { String storageLocation = backup.getStorageLocation(); if (backup.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (backup.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the backup storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } backup.setStorageLocation(storageLocation); } else { LOGGER.debug("Backup is not set, skipping cloud storage location updates."); } return backup; } }
CloudBackupFolderResolverService { public Backup updateStorageLocation(Backup backup, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching backup storage locations with cluster data."); if (backup != null && StringUtils.isNotEmpty(backup.getStorageLocation())) { String storageLocation = backup.getStorageLocation(); if (backup.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (backup.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the backup storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } backup.setStorageLocation(storageLocation); } else { LOGGER.debug("Backup is not set, skipping cloud storage location updates."); } return backup; } CloudBackupFolderResolverService(S3BackupConfigGenerator s3BackupConfigGenerator,
            AdlsGen2BackupConfigGenerator adlsGen2BackupConfigGenerator); }
CloudBackupFolderResolverService { public Backup updateStorageLocation(Backup backup, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching backup storage locations with cluster data."); if (backup != null && StringUtils.isNotEmpty(backup.getStorageLocation())) { String storageLocation = backup.getStorageLocation(); if (backup.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (backup.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the backup storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } backup.setStorageLocation(storageLocation); } else { LOGGER.debug("Backup is not set, skipping cloud storage location updates."); } return backup; } CloudBackupFolderResolverService(S3BackupConfigGenerator s3BackupConfigGenerator,
            AdlsGen2BackupConfigGenerator adlsGen2BackupConfigGenerator); Backup updateStorageLocation(Backup backup, String clusterType,
            String clusterName, String clusterCrn); String resolveS3Location(String location, String clusterType,
            String clusterName, String clusterCrn); String resolveAdlsGen2Location(String location, String clusterType,
            String clusterName, String clusterCrn); }
CloudBackupFolderResolverService { public Backup updateStorageLocation(Backup backup, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching backup storage locations with cluster data."); if (backup != null && StringUtils.isNotEmpty(backup.getStorageLocation())) { String storageLocation = backup.getStorageLocation(); if (backup.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (backup.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the backup storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } backup.setStorageLocation(storageLocation); } else { LOGGER.debug("Backup is not set, skipping cloud storage location updates."); } return backup; } CloudBackupFolderResolverService(S3BackupConfigGenerator s3BackupConfigGenerator,
            AdlsGen2BackupConfigGenerator adlsGen2BackupConfigGenerator); Backup updateStorageLocation(Backup backup, String clusterType,
            String clusterName, String clusterCrn); String resolveS3Location(String location, String clusterType,
            String clusterName, String clusterCrn); String resolveAdlsGen2Location(String location, String clusterType,
            String clusterName, String clusterCrn);  }