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

Srikanth Sundarrajan commented on FALCON-870:
---------------------------------------------

{noformat}
+    private long retentionLimitToMills(String retentionLimit) throws 
NumberFormatException {
+        Frequency frequency = Frequency.fromString(retentionLimit);
+        long timePoint = Long.parseLong(frequency.getFrequency());
+        if (frequency.getTimeUnit() == Frequency.TimeUnit.minutes) {
+            timePoint *= 60;
+        } else if (frequency.getTimeUnit() == Frequency.TimeUnit.hours) {
+            timePoint *= 60 * 60;
+        } else if (frequency.getTimeUnit() == Frequency.TimeUnit.days) {
+            timePoint *= 24 * 60 * 60;
+        } else if (frequency.getTimeUnit() == Frequency.TimeUnit.months) {
+            timePoint *= 31 * 24 * 60 * 60;
+        }
+        return timePoint * 1000;
+    }
{noformat}

It might be worthwhile to consider using Calendar. The current implementation 
might surprise the users.

Also, noticed that the current patch seems to be selectively deleting files in 
a instance directory based on access/modify time. While one might expect an 
instance to be either present or absent, deleting contents partially might 
cause unexpected behavior from a consumer stand point. Also what rules are to 
be enforced vis-a-vis feed validity period on process submission or instance 
operations, that also seems to be missing in the patch.

> Retention support delete files/dirs based on modify time or access time
> -----------------------------------------------------------------------
>
>                 Key: FALCON-870
>                 URL: https://issues.apache.org/jira/browse/FALCON-870
>             Project: Falcon
>          Issue Type: New Feature
>          Components: retention
>            Reporter: zhaoyunjiong
>         Attachments: FALCON-870-2.patch, FALCON-870-3.patch, FALCON-870.patch
>
>
> In our company, we have a requirement that delete files/dirs based on it's 
> create time or access time, so we hope retention supports delete files based 
> on modify time or access time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to