flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aditi Viswanathan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-4282) Add Offset Parameter to WindowAssigners
Date Mon, 08 Aug 2016 09:57:21 GMT

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

Aditi Viswanathan commented on FLINK-4282:
------------------------------------------

Hi Aljoscha,

I've written down an example scenario to make sure that my understanding of
the problem is correct-

Scenario:
Current processing time: 5
Offset: 10
Window size: 100

1st window: start = 10, end = 110; but elements are assigned to this window
from processing time 0 to 100, so the element that comes at processing time
= 5 is assigned to this window

2nd window: start = 110, end = 210; but elements are assigned to this
window from processing time 100 to 200

My implementation will work for the scenario above. I've passed the offset
to the TimeWindow so that the window triggers at 100 (window end - offset)
rather than at 110 (window end) as is the current implementation:

(From ProcessingTimeTrigger)

public TriggerResult onElement(Object element, long timestamp,
TimeWindow window, TriggerContext ctx) {
   ctx.registerProcessingTimeTimer(window.maxTimestamp() - window.getOffset());
   return TriggerResult.CONTINUE;
}

(From TimeWindow)

this.end = end + offset;

@Override
public long maxTimestamp() {
   return end - 1;
}

Please let me know if this makes sense to you, or if there's something
I'm missing.

Thanks,
Aditi





Aditi Viswanathan | +91-9632130809
Data Engineer,
[24]7 Customer Ltd.

On Mon, Aug 8, 2016 at 3:12 PM, Aljoscha Krettek (JIRA) <jira@apache.org>



> Add Offset Parameter to WindowAssigners
> ---------------------------------------
>
>                 Key: FLINK-4282
>                 URL: https://issues.apache.org/jira/browse/FLINK-4282
>             Project: Flink
>          Issue Type: Improvement
>          Components: Streaming
>            Reporter: Aljoscha Krettek
>
> Currently, windows are always aligned to EPOCH, which basically means days are aligned
with GMT. This is somewhat problematic for people living in different timezones.
> And offset parameter would allow to adapt the window assigner to the timezone.



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

Mime
View raw message