You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/01/07 15:56:00 UTC

[jira] [Commented] (NIFI-5854) Enhance time unit features

    [ https://issues.apache.org/jira/browse/NIFI-5854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16735987#comment-16735987 ] 

ASF subversion and git services commented on NIFI-5854:
-------------------------------------------------------

Commit b59fa5af1f3232581e1b3903e3e2f408d9daa323 in nifi's branch refs/heads/master from Andy LoPresto
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=b59fa5a ]

NIFI-5854 Added skeleton logic to convert decimal time units.
Added helper methods.
Added unit tests.

NIFI-5854 [WIP] Cleaned up logic.
Resolved failing unit tests due to error message change.

NIFI-5854 [WIP] All helper method unit tests pass.

NIFI-5854 [WIP] FormatUtils#getPreciseTimeDuration() now handles all tested inputs correctly.
Added unit tests.

NIFI-5854 [WIP] FormatUtils#getTimeDuration() still using long.
Added unit tests.
Renamed existing unit tests to reflect method under test.

NIFI-5854 FormatUtils#getTimeDuration() returns long but now accepts decimal inputs.
Added @Deprecation warnings (will update callers where possible).
All unit tests pass.

NIFI-5854 Fixed unit tests (ran in IDE but not Maven) due to int overflows.
Fixed checkstyle issues.

NIFI-5854 Fixed typo in Javadoc.

NIFI-5854 Fixed typo in Javadoc.

Signed-off-by: Matthew Burgess <ma...@apache.org>

This closes #3193


> Enhance time unit features
> --------------------------
>
>                 Key: NIFI-5854
>                 URL: https://issues.apache.org/jira/browse/NIFI-5854
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>    Affects Versions: 1.8.0
>            Reporter: Andy LoPresto
>            Assignee: Andy LoPresto
>            Priority: Major
>              Labels: parsing, time, units
>
> There is some ambiguity with time units (specifically around processor properties). Two features which I think should be added:
> * Currently only whole numbers are parsed correctly. For example, {{10 milliseconds}} and {{0.010 seconds}} are functionally equivalent, but only the former will be parsed. This is due to the regex used in {{StandardValidators.TIME_PERIOD_VALIDATOR}} which relies on {{FormatUtils.TIME_DURATION_REGEX}} (see below). Decimal amounts should be parsed
> * The enumerated time units are *nanoseconds, milliseconds, seconds, minutes, hours, days, weeks*. While I don't intend to extend this to "millennia", etc. as every unit including and above *months* would be ambiguous, *microseconds* seems like a valid and missing unit
> *Definition of {{FormatUtils.TIME_DURATION_REGEX}}:*
> {code}
>     public static final String TIME_DURATION_REGEX = "(\\d+)\\s*(" + VALID_TIME_UNITS + ")";
>     public static final Pattern TIME_DURATION_PATTERN = Pattern.compile(TIME_DURATION_REGEX);
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)