Skip to content

[FLINK-5296] Expose the old AlignedWindowOperators through special as…#3075

Closed
kl0u wants to merge 2 commits intoapache:masterfrom
kl0u:aligned_refactoring
Closed

[FLINK-5296] Expose the old AlignedWindowOperators through special as…#3075
kl0u wants to merge 2 commits intoapache:masterfrom
kl0u:aligned_refactoring

Conversation

@kl0u
Copy link
Contributor

@kl0u kl0u commented Jan 6, 2017

This PR allows the user to use the deprecated AccumulatingProcessingTimeWindowOperator and AggregatingProcessingTimeWindowOperator by specifying as a WindowAssigner when windowing, the TumblingAlignedProcessingTimeWindows or the SlidingAlignedProcessingTimeWindows.

R @aljoscha

Copy link
Contributor

@aljoscha aljoscha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these changes! 👍 I had some comments about Javadocs.

return LegacyWindowOperatorType.NONE;
}

private <R> SingleOutputStreamOperator<R> createFastTimeOperatorIfValid(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is simply a copy of the old code, right?

* AccumulatingProcessingTimeWindowOperator} and
* {@link org.apache.flink.streaming.runtime.operators.windowing.AggregatingProcessingTimeWindowOperator
* AggregatingProcessingTimeWindowOperator}.
* <p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline.

* AccumulatingProcessingTimeWindowOperator} and the
* {@link org.apache.flink.streaming.runtime.operators.windowing.AggregatingProcessingTimeWindowOperator
* AggregatingProcessingTimeWindowOperator}.
* <p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline.

* With this assigner, the {@code trigger} used is a
* {@link org.apache.flink.streaming.api.windowing.triggers.ProcessingTimeTrigger
* ProcessingTimeTrigger} and no {@code evictor} can be specified.
* <p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline.

* {@link org.apache.flink.streaming.api.windowing.triggers.ProcessingTimeTrigger
* ProcessingTimeTrigger} and no {@code evictor} can be specified.
* <p>
* Bare in mind that no rescaling and no backwards compatibility is supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should have a bigger notice here, possibly with <b> and WARNING.

Also, I think it should be "bear in mind". (https://www.quora.com/Which-is-correct-bare-in-mind-or-bear-in-mind)

* AccumulatingProcessingTimeWindowOperator} and the
* {@link org.apache.flink.streaming.runtime.operators.windowing.AggregatingProcessingTimeWindowOperator
* AggregatingProcessingTimeWindowOperator}.
* <p>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as for the other assigner hold.

@kl0u
Copy link
Contributor Author

kl0u commented Jan 10, 2017

@aljoscha Thanks for the review!
I will integrate the comments and ping you.

@kl0u kl0u force-pushed the aligned_refactoring branch from 07322d8 to 6e9b912 Compare January 11, 2017 11:19
@kl0u
Copy link
Contributor Author

kl0u commented Jan 11, 2017

@aljoscha I integrated your comments.

…signers

The user can use the deprecated AccumulatingProcessingTimeWindowOperator
and AggregatingProcessingTimeWindowOperator by using the
TumblingAlignedProcessingTimeWindows and the
SlidingAlignedProcessingTimeWindows introduced by this
commit. These operators are neither backwards compatibility
nor rescalable.
@kl0u kl0u force-pushed the aligned_refactoring branch from 6e9b912 to 5d461d8 Compare January 11, 2017 14:31
*/
public class TimeWindowTranslationTest {

@Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be covered by the other tests that now exist in this test suite? You probably still have this because these are very recent additions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well this tests that now even for processing time, the timeWindow() leads to a WindowOperator being instantiated, rather than an aligned one. I can explicitly
add the TimeCharacteristic. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, then we can keep it but should update the method name and maybe give a javadoc that describes them.

*/
class WindowTranslationTest {

@Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably also a leftover from before I refactored the WindowTranslationTest?

Copy link
Contributor Author

@kl0u kl0u Jan 11, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above.

@kl0u
Copy link
Contributor Author

kl0u commented Jan 11, 2017

@aljoscha thanks for the review.
I changed the names of the tests and also put them in the right classes.
Let me know what you think.

@aljoscha
Copy link
Contributor

Thanks for your work! 👍

Could you please close this PR? I merged it.

@kl0u
Copy link
Contributor Author

kl0u commented Jan 12, 2017

Thanks @aljoscha . Will do that.

@kl0u kl0u closed this Jan 12, 2017
@kl0u kl0u deleted the aligned_refactoring branch March 15, 2017 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments