@Test public void testUpdateStorageLocationWithoutTelemetry() { Telemetry telemetry = null; underTest.updateStorageLocation(telemetry, null, null, null); assertNull(telemetry); }
public void updateStorageLocation(Telemetry telemetry, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching telemetry storage locations with cluster data."); if (telemetry != null && telemetry.getLogging() != null && StringUtils.isNotEmpty(telemetry.getLogging().getStorageLocation())) { Logging logging = telemetry.getLogging(); String storageLocation = logging.getStorageLocation(); if (logging.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getGcs() != null) { storageLocation = resolveGcsLocation(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the telemetry logging storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } logging.setStorageLocation(storageLocation); } else { LOGGER.debug("Telemetry is not set, skipping cloud storage location updates."); } }
CloudStorageFolderResolverService { public void updateStorageLocation(Telemetry telemetry, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching telemetry storage locations with cluster data."); if (telemetry != null && telemetry.getLogging() != null && StringUtils.isNotEmpty(telemetry.getLogging().getStorageLocation())) { Logging logging = telemetry.getLogging(); String storageLocation = logging.getStorageLocation(); if (logging.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getGcs() != null) { storageLocation = resolveGcsLocation(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the telemetry logging storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } logging.setStorageLocation(storageLocation); } else { LOGGER.debug("Telemetry is not set, skipping cloud storage location updates."); } } }
CloudStorageFolderResolverService { public void updateStorageLocation(Telemetry telemetry, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching telemetry storage locations with cluster data."); if (telemetry != null && telemetry.getLogging() != null && StringUtils.isNotEmpty(telemetry.getLogging().getStorageLocation())) { Logging logging = telemetry.getLogging(); String storageLocation = logging.getStorageLocation(); if (logging.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getGcs() != null) { storageLocation = resolveGcsLocation(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the telemetry logging storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } logging.setStorageLocation(storageLocation); } else { LOGGER.debug("Telemetry is not set, skipping cloud storage location updates."); } } CloudStorageFolderResolverService(S3ConfigGenerator s3ConfigGenerator,
            AdlsGen2ConfigGenerator adlsGen2ConfigGenerator,
            GcsConfigGenerator gcsConfigGenerator); }
CloudStorageFolderResolverService { public void updateStorageLocation(Telemetry telemetry, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching telemetry storage locations with cluster data."); if (telemetry != null && telemetry.getLogging() != null && StringUtils.isNotEmpty(telemetry.getLogging().getStorageLocation())) { Logging logging = telemetry.getLogging(); String storageLocation = logging.getStorageLocation(); if (logging.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getGcs() != null) { storageLocation = resolveGcsLocation(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the telemetry logging storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } logging.setStorageLocation(storageLocation); } else { LOGGER.debug("Telemetry is not set, skipping cloud storage location updates."); } } CloudStorageFolderResolverService(S3ConfigGenerator s3ConfigGenerator,
            AdlsGen2ConfigGenerator adlsGen2ConfigGenerator,
            GcsConfigGenerator gcsConfigGenerator); void updateStorageLocation(Telemetry telemetry, 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); String resolveGcsLocation(String location, String clusterType,
            String clusterName, String clusterCrn); }
CloudStorageFolderResolverService { public void updateStorageLocation(Telemetry telemetry, String clusterType, String clusterName, String clusterCrn) { LOGGER.debug("Updating/enriching telemetry storage locations with cluster data."); if (telemetry != null && telemetry.getLogging() != null && StringUtils.isNotEmpty(telemetry.getLogging().getStorageLocation())) { Logging logging = telemetry.getLogging(); String storageLocation = logging.getStorageLocation(); if (logging.getS3() != null) { storageLocation = resolveS3Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getAdlsGen2() != null) { storageLocation = resolveAdlsGen2Location(storageLocation, clusterType, clusterName, clusterCrn); } else if (logging.getGcs() != null) { storageLocation = resolveGcsLocation(storageLocation, clusterType, clusterName, clusterCrn); } else { LOGGER.warn("None of the telemetry logging storage location was resolved, " + "make sure storage type is set properly (currently supported: s3, abfs)"); } logging.setStorageLocation(storageLocation); } else { LOGGER.debug("Telemetry is not set, skipping cloud storage location updates."); } } CloudStorageFolderResolverService(S3ConfigGenerator s3ConfigGenerator,
            AdlsGen2ConfigGenerator adlsGen2ConfigGenerator,
            GcsConfigGenerator gcsConfigGenerator); void updateStorageLocation(Telemetry telemetry, 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); String resolveGcsLocation(String location, String clusterType,
            String clusterName, String clusterCrn);  }