KAFKA-4671: Fix Streams window retention policy#2401
KAFKA-4671: Fix Streams window retention policy#2401mjsax wants to merge 4 commits intoapache:trunkfrom
Conversation
|
Extracted code changes from #2337 @dguy @enothereska @guozhangwang Should go into |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
dguy
left a comment
There was a problem hiding this comment.
Just a general comment on the test names. I see you change some test names in JoinWindowsTest to be more descriptive - thanks.
However, in the other tests, i.e., SessionWindowsTest, TimeWindowsTest etc, we still have non-descriptive test names. It is great that we have the tests, but it is much better if we can just read the test names and work out what it is doing. This is why i almost always start the name of a test with should. I.e, what should it do? I'm sorry to bang on about this, but i find it super useful and important. If the test names are descriptive then you can usually understand what a class does without having to read the code.
|
|
||
| @Override | ||
| public final boolean equals(Object o) { | ||
| public Windows<Window> until(final long duration) throws IllegalArgumentException { |
There was a problem hiding this comment.
Change return type to JoinWindows (same for all other classed inheriting from Windows)
|
Updated this. |
rename test methods
a84369f to
9488b66
Compare
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
test this please |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
LGTM |
|
|
||
| private final long gapMs; | ||
| private long maintainDurationMs; | ||
| private final long gap; |
There was a problem hiding this comment.
Not clear why removing Ms suffix?
| public TimeWindows advanceBy(long interval) { | ||
| return new TimeWindows(this.size, interval); | ||
| public TimeWindows advanceBy(final long advance) { | ||
| if (!(0 < advance && advance <= size)) { |
There was a problem hiding this comment.
nit: if (advance <= 0 || advance > size)
| static final long DEFAULT_MAINTAIN_DURATION = 24 * 60 * 60 * 1000L; // one day (if time is represented as ms) | ||
|
|
||
| private long maintainDurationMs; | ||
| private long maintainDuration; |
| public JoinWindows until(final long duration) throws IllegalArgumentException { | ||
| if (duration < size()) { | ||
| throw new IllegalArgumentException("Window retention time (duration) cannot be smaller than the window " + | ||
| "size."); |
There was a problem hiding this comment.
nit: this can be a single line.
|
@guozhangwang Updated. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
@guozhangwang Updated all variables with |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
retest this please |
Author: Matthias J. Sax <matthias@confluent.io> Reviewers: Damian Guy, Eno Thereska, Guozhang Wang Closes #2401 from mjsax/kafka-4671-window-retention-policy (cherry picked from commit 7998759) Signed-off-by: Guozhang Wang <wangguoz@gmail.com>
|
LGTM. Merged to trunk and 0.10.2. |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
|
Refer to this link for build results (access rights to CI server needed): |
Author: Matthias J. Sax <matthias@confluent.io> Reviewers: Damian Guy, Eno Thereska, Guozhang Wang Closes apache#2401 from mjsax/kafka-4671-window-retention-policy
No description provided.