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

ASF GitHub Bot commented on KAFKA-7446:
---------------------------------------

mrsrinivas opened a new pull request #5930: [WIP] KAFKA-7446: Better error 
messages on `WindowDuration` and `AdvanceInterval`
URL: https://github.com/apache/kafka/pull/5930
 
 
   
   Changes made as part of this PR
    - Added new `Exception` classes for `WindowDuration` and `AdvanceInterval`
    - Improved error message for better readability
    - Corrected java documentation on `AdvanceInterval` check.
    - Improved JUnit tests with `expected` attribute in `@Test`
   
   Core and Streams modules' JUnit tests are successful in local but 
   tests related to file system is failed since I am running on Windows. 
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Better error message to explain the upper limit of TimeWindow
> -------------------------------------------------------------
>
>                 Key: KAFKA-7446
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7446
>             Project: Kafka
>          Issue Type: Improvement
>          Components: streams
>    Affects Versions: 2.0.0
>            Reporter: Jacek Laskowski
>            Assignee: Srinivas Reddy
>            Priority: Trivial
>              Labels: newbie++
>
> The following code throws a {{IllegalArgumentException}}.
> {code:java}
> import org.apache.kafka.streams.kstream.TimeWindows
> import scala.concurrent.duration._
> val timeWindow = TimeWindows
> .of(1.minute.toMillis)
> .advanceBy(2.minutes.toMillis)
> {code}
> The exception is as follows and it's not clear why {{60000}} is the upper 
> limit (not to mention that {{AdvanceMs}} with the uppercase {{A}} did also 
> confuse me).
> {code:java}
> java.lang.IllegalArgumentException: AdvanceMs must lie within interval (0, 
> 60000].
> at 
> org.apache.kafka.streams.kstream.TimeWindows.advanceBy(TimeWindows.java:100)
> ... 44 elided{code}
> I think that the message should be more developer-friendly and explain the 
> boundaries, perhaps with an example (and a link to docs)?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to