summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/dcaegen2/services/pmmapper/config/FilesProcessingConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/dcaegen2/services/pmmapper/config/FilesProcessingConfig.java')
-rw-r--r--src/main/java/org/onap/dcaegen2/services/pmmapper/config/FilesProcessingConfig.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/org/onap/dcaegen2/services/pmmapper/config/FilesProcessingConfig.java b/src/main/java/org/onap/dcaegen2/services/pmmapper/config/FilesProcessingConfig.java
index c79f059..e4fd0b2 100644
--- a/src/main/java/org/onap/dcaegen2/services/pmmapper/config/FilesProcessingConfig.java
+++ b/src/main/java/org/onap/dcaegen2/services/pmmapper/config/FilesProcessingConfig.java
@@ -1,6 +1,7 @@
/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2021 Nokia.
+ * Copyright (C) 2021 Samsung Electronics.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -35,6 +36,7 @@ public class FilesProcessingConfig {
private static final int DEFAULT_LIMIT_RATE = 1;
private static final String ENV_THREADS_MULTIPLIER = "THREADS_MULTIPLIER";
private static final String ENV_PROCESSING_THREADS_COUNT = "PROCESSING_THREADS_COUNT";
+ private static final String ENV_VARIABLE_INCORRECT_MSG = " environment variable has incorrect value.\n";
private static final int DEFAULT_MULTIPLIER = 1;
private static final ONAPLogAdapter logger = new ONAPLogAdapter(
@@ -61,7 +63,7 @@ public class FilesProcessingConfig {
.orElseGet(this::getDefaultLimitRate);
} catch (NumberFormatException exception) {
throw new EnvironmentConfigException(
- ENV_LIMIT_RATE + " environment variable has incorrect value.\n"
+ ENV_LIMIT_RATE + ENV_VARIABLE_INCORRECT_MSG
, exception);
}
}
@@ -88,7 +90,7 @@ public class FilesProcessingConfig {
private Integer parseIntegerValue(String val) throws NumberFormatException {
Integer value = Integer.valueOf(val);
- logger.unwrap().info(ENV_LIMIT_RATE + " value is: " + value);
+ logger.unwrap().info(ENV_LIMIT_RATE + " value is: {}", value);
return value;
}
@@ -104,7 +106,7 @@ public class FilesProcessingConfig {
.orElseGet(this::getDefaultMultiplier);
} catch (NumberFormatException exception) {
throw new EnvironmentConfigException(
- ENV_THREADS_MULTIPLIER + " environment variable has incorrect value.\n", exception);
+ ENV_THREADS_MULTIPLIER + ENV_VARIABLE_INCORRECT_MSG, exception);
}
}
@@ -121,14 +123,14 @@ public class FilesProcessingConfig {
.orElseGet(this::getDefaultThreadsCount);
} catch (NumberFormatException exception) {
throw new EnvironmentConfigException(
- ENV_PROCESSING_THREADS_COUNT + " environment variable has incorrect value.\n", exception);
+ ENV_PROCESSING_THREADS_COUNT + ENV_VARIABLE_INCORRECT_MSG, exception);
}
}
private int getDefaultThreadsCount() {
int defaultThreadsCount = Runtime.getRuntime().availableProcessors();
logger.unwrap().info(ENV_PROCESSING_THREADS_COUNT +
- " env not present. Setting threads count to available cores: " + defaultThreadsCount);
+ " env not present. Setting threads count to available cores: {}", defaultThreadsCount);
return defaultThreadsCount;
}
}