New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPARK-2745 [STREAMING] Add Java friendly methods to Duration class #2403
Conversation
…a-friendliness. Also add unit tests for Duration, in Scala and Java.
QA tests have started for PR 2403 at commit
|
QA tests have finished for PR 2403 at commit
|
@srowen I think that in addition to these, it would be nice to have static constructor methods, such as Duration.seconds(500) and Duration.minutes(10). Mind adding those too? |
@mateiz Will do. There's one catch. Since I'll also add tests, and give (PS the scalastyle checks fail because there appear to be binary operators without surrounding space. I believe it's necessary to disable the checks in that section of declarations, since they're not actually usages of a binary operator.) |
…ds seconds(), minutes() to Duration. Add Java-friendly methods to Time too, and unit tests. Remove unnecessary math.floor from Time.floor()
QA tests have started for PR 2403 at commit
|
Ah, sure, I think we can just skip milliseconds in that case. For the scalastyle checks, why not use spaces around the operators instead? They should work in that context. You can just do |
QA tests have finished for PR 2403 at commit
|
@mateiz Ah of course. I overlooked the obvious somehow. I'm looking at why MIMA binary checks fail to see if it has a point or not now. |
QA tests have started for PR 2403 at commit
|
QA tests have finished for PR 2403 at commit
|
I'm not sure what to make of the MIMA errors:
I assume this is a side-effect of adding |
Yeah, these seem like false positives. @ScrapCodes can you take a look and suggest how to update the MIMA rules if these are indeed false positives? |
Actually it may also be the case that the object doesn't work quite the way the default companion object for a case class should. Can you double check that stuff like |
Yeah I think this is an actual problem, see https://issues.scala-lang.org/browse/SI-3664. Maybe we should just go with Durations for simplicity. |
I guess we will have to exclude those in MimaExcludes.scala. If this happens too often, then may be we can ignore toString for all classes possible. |
QA tests have started for PR 2403 at commit
|
QA tests have finished for PR 2403 at commit
|
Thanks, this looks good. |
@tdas is this what you had in mind for this JIRA? I saw this one and thought it would be easy to take care of, and helpful as I use streaming from Java.
I could do the same for
Time
? Happy to do so.