Skip to content

MINOR: rework JavaDoc for windowing related public API#2337

Closed
mjsax wants to merge 2 commits intoapache:trunkfrom
mjsax:javaDocImprovements4
Closed

MINOR: rework JavaDoc for windowing related public API#2337
mjsax wants to merge 2 commits intoapache:trunkfrom
mjsax:javaDocImprovements4

Conversation

@mjsax
Copy link
Copy Markdown
Member

@mjsax mjsax commented Jan 9, 2017

  • also some code refactoring and bug fixes

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Jan 9, 2017

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/650/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/649/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 9, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/648/
Test FAILed (JDK 7 and Scala 2.10).

@guozhangwang
Copy link
Copy Markdown
Contributor

test this please

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/652/
Test FAILed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/651/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 10, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/650/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 18, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/971/
Test FAILed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 18, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/971/
Test FAILed (JDK 7 and Scala 2.10).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 18, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/973/
Test FAILed (JDK 8 and Scala 2.11).

@dguy
Copy link
Copy Markdown
Contributor

dguy commented Jan 18, 2017

Test failures look legitimate. Looks like you will need to change the tests as the have TimeWindow with the same start and end time.
Besides that, would it not better to do the javadoc changes and code changes separate PRs?

@mjsax mjsax force-pushed the javaDocImprovements4 branch from e2c6fda to 60cfa8e Compare January 18, 2017 09:59
@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Jan 18, 2017

@dguy you are too fast :)

About splitting code and docs update. It would be better (I did split out already SessionWindow PR), but hard to split up the rest now... (Did not expect to hit so many issues :( ) If you don't insist on it, I would rather keep it as is.

Updated this. @enothereska @guozhangwang

Copy link
Copy Markdown
Contributor

@dguy dguy left a comment

Choose a reason for hiding this comment

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

A few comments mostly about test naming. In general i think more descriptive test names are better.
Besides that my only other concerns are:

  1. this is +1000 lines and it is a MINOR PR.
  2. I already mentioned it is not just javadoc, but code changes.

I'm happy to defer to others judgement on both of those points.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe rename to sth like: endTimeShouldNotBeBeforeStart

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i'd rename this to something more descriptive, too. Though i just realised this and the last haven't changed in this PR!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What are we testing about until?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Again i feel there is a more descriptive name for this test.
sth like: shouldUseWindowSizeForMaintainMsWhenSizeLargerThanDefaultMaintainMs

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 18, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/982/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 18, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/984/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 18, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/982/
Test FAILed (JDK 7 and Scala 2.10).

@enothereska
Copy link
Copy Markdown
Contributor

+1 on having separate PRs, ideally.

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Jan 18, 2017

Extracted code changes in #2401
Will rebase this after #2401 got merged.

@mjsax mjsax force-pushed the javaDocImprovements4 branch from 60cfa8e to e5c2d33 Compare January 24, 2017 08:49
@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Jan 24, 2017

Updated this. @enothereska @dguy @guozhangwang

* Both values (before and after) must not result in an "inverse" window,
* i.e., lower-interval-bound must not be larger than upper-interval.bound.
* Both values (before and after) must not result in an "inverse" window, i.e., upper-interval-bound cannot be smaller
* than lower-interval bound.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do you want this to be "lower-interval-bound" to be consistent with "upper-interval-bound", or vice-versa?

* Specifies that records of the same key are joinable if their timestamps are within
* the join window interval, and if the timestamp of a record from the secondary stream
* is later than or equal to the timestamp of a record from the first stream.
* Changes the end window boundary to {@code timeDifferenceMs} but keep the start window boundary as-is.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as is

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 24, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/1139/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 24, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/1137/
Test PASSed (JDK 8 and Scala 2.12).


/**
* Set the window maintain duration in milliseconds of streams time.
* Set the window maintain duration (retention time) in milliseconds.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need "duration" or "maintain" ? Can't we say just ...the window retention time...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We have public method maintainMs() that returns retention time and I would like to mirror this connection in the JavaDocs. Or we rename the method to retentionMs(), but this would need a KIP. For now, I would leave it as is, but will put the renaming ides into the uber API KIP I am going to do.

Does this make sense?

/**
* Specify the number of segments to be used for rolling the window store,
* this function is not exposed to users but can be called by developers that extend this JoinWindows specs.
* Return the window maintain duration (retention time) in milliseconds.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here and below.

@enothereska
Copy link
Copy Markdown
Contributor

Minor nits, otherwise LGTM, thanks @mjsax

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 24, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/1137/
Test PASSed (JDK 7 and Scala 2.10).

* This implies, that each input record defines its own window with start and end time being relative to the record's
* timestamp.
* <p>
* For time semantics, compare {@link org.apache.kafka.streams.processor.TimestampExtractor TimestampExtractor}.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not clear to me: "compare TimestampExtractor"? Or rather "see TimestampExtractor"?

* Specifies that records of the same key are joinable if their timestamps are within
* the join window interval, and if the timestamp of a record from the secondary stream is
* earlier than or equal to the timestamp of a record from the first stream.
* Changes the start window boundary to {@code timeDifferenceMs} but keep the end window boundary as-is.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

as is.

* the join window interval, and if the timestamp of a record from the secondary stream
* is later than or equal to the timestamp of a record from the first stream.
* Changes the end window boundary to {@code timeDifferenceMs} but keep the start window boundary as-is.
* Thus, records of the same key are joinable if the timestamp of a record from the secondary stream is max
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

max timeDifferenceMs later than -> at most ...

* maintain duration.
* <p>
* If not explicitly specified, the default maintain duration is 1 day.
* For time semantics, compare {@link org.apache.kafka.streams.processor.TimestampExtractor TimestampExtractor}.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ditto here.

@mjsax
Copy link
Copy Markdown
Member Author

mjsax commented Jan 24, 2017

@guozhangwang @enothereska @dguy Addresses all you comments.

asfgit pushed a commit that referenced this pull request Jan 24, 2017
 - also some code refactoring and bug fixes

Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Damian Guy, Eno Thereska, Guozhang Wang

Closes #2337 from mjsax/javaDocImprovements4

(cherry picked from commit b938c03)
Signed-off-by: Guozhang Wang <wangguoz@gmail.com>
@guozhangwang
Copy link
Copy Markdown
Contributor

Merged to trunk and 0.10.2.

@asfgit asfgit closed this in b938c03 Jan 24, 2017
@asfbot
Copy link
Copy Markdown

asfbot commented Jan 24, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.12/1157/
Test PASSed (JDK 8 and Scala 2.12).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 24, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk8-scala2.11/1159/
Test PASSed (JDK 8 and Scala 2.11).

@asfbot
Copy link
Copy Markdown

asfbot commented Jan 24, 2017

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/kafka-pr-jdk7-scala2.10/1157/
Test PASSed (JDK 7 and Scala 2.10).

@mjsax mjsax deleted the javaDocImprovements4 branch January 24, 2017 19:23
soenkeliebau pushed a commit to soenkeliebau/kafka that referenced this pull request Feb 7, 2017
 - also some code refactoring and bug fixes

Author: Matthias J. Sax <matthias@confluent.io>

Reviewers: Damian Guy, Eno Thereska, Guozhang Wang

Closes apache#2337 from mjsax/javaDocImprovements4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants