@Test(expected = CloudbreakServiceException.class) public void testCreateFluentConfigWithoutLocation() { Logging logging = new Logging(); logging.setStorageLocation(null); logging.setAdlsGen2(new AdlsGen2CloudStorageV1Parameters()); Telemetry telemetry = new Telemetry(); telemetry.setLogging(logging); underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, telemetry); }
public FluentConfigView createFluentConfigs(TelemetryClusterDetails clusterDetails, boolean databusEnabled, boolean meteringEnabled, Telemetry telemetry) { final FluentConfigView.Builder builder = new FluentConfigView.Builder(); boolean enabled = false; if (telemetry != null) { if (telemetry.getFluentAttributes() != null) { builder.withOverrideAttributes( telemetry.getFluentAttributes() != null ? new HashMap<>(telemetry.getFluentAttributes()) : new HashMap<>() ); } enabled = determineAndSetLogging(builder, telemetry, databusEnabled, meteringEnabled); if (telemetry.isClusterLogsCollectionEnabled()) { LOGGER.debug("Set anonymization rules (only for cluster log collection)"); builder.withAnonymizationRules(anonymizationRuleResolver.decodeRules(telemetry.getRules())); } if (enabled && meteringEnabled) { builder .withMeteringAppName(meteringConfiguration.getDbusAppName()) .withMeteringStreamName(meteringConfiguration.getDbusAppName()); } } if (!enabled) { LOGGER.debug("Fluent based logging is disabled"); } return builder .withEnabled(enabled) .withClusterDetails(clusterDetails) .build(); }
FluentConfigService { public FluentConfigView createFluentConfigs(TelemetryClusterDetails clusterDetails, boolean databusEnabled, boolean meteringEnabled, Telemetry telemetry) { final FluentConfigView.Builder builder = new FluentConfigView.Builder(); boolean enabled = false; if (telemetry != null) { if (telemetry.getFluentAttributes() != null) { builder.withOverrideAttributes( telemetry.getFluentAttributes() != null ? new HashMap<>(telemetry.getFluentAttributes()) : new HashMap<>() ); } enabled = determineAndSetLogging(builder, telemetry, databusEnabled, meteringEnabled); if (telemetry.isClusterLogsCollectionEnabled()) { LOGGER.debug("Set anonymization rules (only for cluster log collection)"); builder.withAnonymizationRules(anonymizationRuleResolver.decodeRules(telemetry.getRules())); } if (enabled && meteringEnabled) { builder .withMeteringAppName(meteringConfiguration.getDbusAppName()) .withMeteringStreamName(meteringConfiguration.getDbusAppName()); } } if (!enabled) { LOGGER.debug("Fluent based logging is disabled"); } return builder .withEnabled(enabled) .withClusterDetails(clusterDetails) .build(); } }
FluentConfigService { public FluentConfigView createFluentConfigs(TelemetryClusterDetails clusterDetails, boolean databusEnabled, boolean meteringEnabled, Telemetry telemetry) { final FluentConfigView.Builder builder = new FluentConfigView.Builder(); boolean enabled = false; if (telemetry != null) { if (telemetry.getFluentAttributes() != null) { builder.withOverrideAttributes( telemetry.getFluentAttributes() != null ? new HashMap<>(telemetry.getFluentAttributes()) : new HashMap<>() ); } enabled = determineAndSetLogging(builder, telemetry, databusEnabled, meteringEnabled); if (telemetry.isClusterLogsCollectionEnabled()) { LOGGER.debug("Set anonymization rules (only for cluster log collection)"); builder.withAnonymizationRules(anonymizationRuleResolver.decodeRules(telemetry.getRules())); } if (enabled && meteringEnabled) { builder .withMeteringAppName(meteringConfiguration.getDbusAppName()) .withMeteringStreamName(meteringConfiguration.getDbusAppName()); } } if (!enabled) { LOGGER.debug("Fluent based logging is disabled"); } return builder .withEnabled(enabled) .withClusterDetails(clusterDetails) .build(); } FluentConfigService(S3ConfigGenerator s3ConfigGenerator,
            AdlsGen2ConfigGenerator adlsGen2ConfigGenerator,
            GcsConfigGenerator gcsConfigGenerator,
            AnonymizationRuleResolver anonymizationRuleResolver,
            MeteringConfiguration meteringConfiguration); }
FluentConfigService { public FluentConfigView createFluentConfigs(TelemetryClusterDetails clusterDetails, boolean databusEnabled, boolean meteringEnabled, Telemetry telemetry) { final FluentConfigView.Builder builder = new FluentConfigView.Builder(); boolean enabled = false; if (telemetry != null) { if (telemetry.getFluentAttributes() != null) { builder.withOverrideAttributes( telemetry.getFluentAttributes() != null ? new HashMap<>(telemetry.getFluentAttributes()) : new HashMap<>() ); } enabled = determineAndSetLogging(builder, telemetry, databusEnabled, meteringEnabled); if (telemetry.isClusterLogsCollectionEnabled()) { LOGGER.debug("Set anonymization rules (only for cluster log collection)"); builder.withAnonymizationRules(anonymizationRuleResolver.decodeRules(telemetry.getRules())); } if (enabled && meteringEnabled) { builder .withMeteringAppName(meteringConfiguration.getDbusAppName()) .withMeteringStreamName(meteringConfiguration.getDbusAppName()); } } if (!enabled) { LOGGER.debug("Fluent based logging is disabled"); } return builder .withEnabled(enabled) .withClusterDetails(clusterDetails) .build(); } FluentConfigService(S3ConfigGenerator s3ConfigGenerator,
            AdlsGen2ConfigGenerator adlsGen2ConfigGenerator,
            GcsConfigGenerator gcsConfigGenerator,
            AnonymizationRuleResolver anonymizationRuleResolver,
            MeteringConfiguration meteringConfiguration); FluentConfigView createFluentConfigs(TelemetryClusterDetails clusterDetails,
            boolean databusEnabled, boolean meteringEnabled, Telemetry telemetry); }
FluentConfigService { public FluentConfigView createFluentConfigs(TelemetryClusterDetails clusterDetails, boolean databusEnabled, boolean meteringEnabled, Telemetry telemetry) { final FluentConfigView.Builder builder = new FluentConfigView.Builder(); boolean enabled = false; if (telemetry != null) { if (telemetry.getFluentAttributes() != null) { builder.withOverrideAttributes( telemetry.getFluentAttributes() != null ? new HashMap<>(telemetry.getFluentAttributes()) : new HashMap<>() ); } enabled = determineAndSetLogging(builder, telemetry, databusEnabled, meteringEnabled); if (telemetry.isClusterLogsCollectionEnabled()) { LOGGER.debug("Set anonymization rules (only for cluster log collection)"); builder.withAnonymizationRules(anonymizationRuleResolver.decodeRules(telemetry.getRules())); } if (enabled && meteringEnabled) { builder .withMeteringAppName(meteringConfiguration.getDbusAppName()) .withMeteringStreamName(meteringConfiguration.getDbusAppName()); } } if (!enabled) { LOGGER.debug("Fluent based logging is disabled"); } return builder .withEnabled(enabled) .withClusterDetails(clusterDetails) .build(); } FluentConfigService(S3ConfigGenerator s3ConfigGenerator,
            AdlsGen2ConfigGenerator adlsGen2ConfigGenerator,
            GcsConfigGenerator gcsConfigGenerator,
            AnonymizationRuleResolver anonymizationRuleResolver,
            MeteringConfiguration meteringConfiguration); FluentConfigView createFluentConfigs(TelemetryClusterDetails clusterDetails,
            boolean databusEnabled, boolean meteringEnabled, Telemetry telemetry);  }