adelapena commented on code in PR #1758:
URL: https://github.com/apache/cassandra/pull/1758#discussion_r933094235
##########
src/java/org/apache/cassandra/config/Converters.java:
##########
@@ -69,44 +69,47 @@
*/
SECONDS_CUSTOM_DURATION(String.class, DurationSpec.IntSecondsBound.class,
DurationSpec.IntSecondsBound::inSecondsString,
- o -> Long.toString(o.toSeconds())),
+ o -> o == null ? null :
Long.toString(o.toSeconds())),
/**
* This converter is used to support backward compatibility for parameters
where in the past -1 was used as a value
* Example: index_summary_resize_interval_in_minutes = -1 and
index_summary_resize_interval = null are equal.
*/
MINUTES_CUSTOM_DURATION(Integer.class, DurationSpec.IntMinutesBound.class,
- o -> o == -1 ? null : new DurationSpec.IntMinutesBound(o),
- o -> o == null ? -1 : o.toMinutes()),
+ o -> o == -1 ? null : new
DurationSpec.IntMinutesBound(o),
+ o -> o == null ? -1 : o.toMinutes()),
MEBIBYTES_DATA_STORAGE_LONG(Long.class,
DataStorageSpec.LongMebibytesBound.class,
DataStorageSpec.LongMebibytesBound::new,
-
DataStorageSpec.LongMebibytesBound::toMebibytes),
+ o -> o == null ? null : o.toMebibytes()),
MEBIBYTES_DATA_STORAGE_INT(Integer.class,
DataStorageSpec.IntMebibytesBound.class,
DataStorageSpec.IntMebibytesBound::new,
- DataStorageSpec.IntMebibytesBound::toMebibytes),
+ o -> o == null ? null : o.toMebibytes()),
+ NEGATIVE_MEBIBYTES_DATA_STORAGE_INT(Integer.class,
DataStorageSpec.IntMebibytesBound.class,
+ o -> o < 0 ? null : new
DataStorageSpec.IntMebibytesBound(o),
+ o -> o == null ? -1 : o.toMebibytes()),
Review Comment:
Trivial nit that can be addressed on commit: the parameters are misaligned
after renaming the converter.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]