You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pinot.apache.org by GitBox <gi...@apache.org> on 2018/11/21 23:04:05 UTC
[GitHub] jenniferdai commented on a change in pull request #3505: Handle
invalid durations in the duration DSL
jenniferdai commented on a change in pull request #3505: Handle invalid durations in the duration DSL
URL: https://github.com/apache/incubator-pinot/pull/3505#discussion_r235562115
##########
File path: pinot-common/src/main/java/com/linkedin/pinot/common/config/DurationDsl.java
##########
@@ -28,14 +28,22 @@ public Duration parse(String text) {
return null;
}
- String[] parts = text.split(" ");
- final String unit = parts[1].toUpperCase();
- final String unitCount = parts[0];
- return new Duration(TimeUnit.valueOf(unit), Integer.parseInt(unitCount));
+ try {
+ String[] parts = text.split(" ");
+ final String unit = parts[1].toUpperCase();
+ final String unitCount = parts[0];
+ return new Duration(TimeUnit.valueOf(unit), Integer.parseInt(unitCount));
+ } catch (Exception e) {
+ return null;
Review comment:
do you want to log something here before returning?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pinot.apache.org
For additional commands, e-mail: dev-help@pinot.apache.org