ibessonov commented on code in PR #5638:
URL: https://github.com/apache/ignite-3/pull/5638#discussion_r2044247908
##########
modules/storage-page-memory/src/main/java/org/apache/ignite/internal/storage/pagememory/PersistentPageMemoryDataRegion.java:
##########
@@ -199,52 +202,81 @@ private void initThrottling(PersistentPageMemory
pageMemory) {
}
private ThrottlingType getThrottlingType() {
- SystemPropertyView throttlingTypeCfg = systemLocalConfig == null
- ? null
- :
systemLocalConfig.value().properties().get(THROTTLING_TYPE_SYSTEM_PROPERTY);
-
- ThrottlingType throttlingType = ThrottlingType.SPEED_BASED;
-
- if (throttlingTypeCfg != null) {
- try {
- throttlingType =
ThrottlingType.valueOf(throttlingTypeCfg.propertyValue().toUpperCase());
- } catch (IllegalArgumentException e) {
- LOG.warn(
- "Invalid throttling configuration {}={}, using default
value {}",
- THROTTLING_TYPE_SYSTEM_PROPERTY,
- throttlingTypeCfg.propertyValue(),
- throttlingType
- );
- }
- }
- return throttlingType;
+ return getSystemConfig(THROTTLING_TYPE_SYSTEM_PROPERTY,
+ ThrottlingType.SPEED_BASED,
+ value -> ThrottlingType.valueOf(value.toUpperCase())
+ );
}
private long getLoggingThreshold() {
- SystemPropertyView logThresholdCfg = systemLocalConfig == null
- ? null
- :
systemLocalConfig.value().properties().get(THROTTLING_LOG_THRESHOLD_SYSTEM_PROPERTY);
+ return TimeUnit.MILLISECONDS.toNanos(getSystemConfig(
+ THROTTLING_LOG_THRESHOLD_SYSTEM_PROPERTY,
+
TimeUnit.NANOSECONDS.toMillis(PagesWriteThrottlePolicy.DEFAULT_LOGGING_THRESHOLD),
+ value -> {
+ long logThresholdMillis = Long.parseLong(value);
- long logThresholdNanos =
PagesWriteThrottlePolicy.DEFAULT_LOGGING_THRESHOLD;
- try {
- if (logThresholdCfg != null) {
- long logThresholdMillis =
Long.parseLong(logThresholdCfg.propertyValue());
+ if (logThresholdMillis <= 0) {
+ throw new IllegalArgumentException();
Review Comment:
The message is ignored in the "catch", but I agree that some clarification
would be helpful.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]