dcapwell commented on a change in pull request #1335:
URL: https://github.com/apache/cassandra/pull/1335#discussion_r808407579
##########
File path:
src/java/org/apache/cassandra/config/SmallestDurationMilliseconds.java
##########
@@ -54,4 +58,27 @@ public static SmallestDurationMilliseconds
inMilliseconds(long milliseconds)
{
return new SmallestDurationMilliseconds(milliseconds,
TimeUnit.MILLISECONDS);
}
+
+ /**
+ * Creates a {@code SmallestDurationMilliseconds} of the specified amount
of milliseconds. Custom method for special cases.
+ *
+ * @param value may be a simple number (assumed to be in milliseconds) or
representation the constructor can handle
+ * @return a duration
+ */
+ public static SmallestDurationMilliseconds inMillisecondsString(String
value)
+ {
+ //parse the string field value
+ Matcher matcher = VALUES_PATTERN.matcher(value);
+
+ long millis;
+ //if the provided string value is just a number, then we create a
Duration Spec
+ if (matcher.matches())
+ {
+ millis = Long.parseLong(value);
Review comment:
`"42"` -> `"42ms"` in this class. We have the same logic in
`SmallestDurationSeconds`
--
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]