-
Notifications
You must be signed in to change notification settings - Fork 262
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
Support for Guava rangeset #168
Comments
@TuomasKiviaho sounds like an interesting idea! Can you elaborate a bit more how would you express each cron field and provide some pseudocode examples? Thanks! |
Timestamps can't be expressed feasibly as explained in https://softwareengineering.stackexchange.com/questions/257121/converting-cron-schedule-to-time-intervals. The individual fields of CRON (well maybe not all of the variants, but at least Quartz can) on the other hand can. Individual fields would be treated as separate range sets and I believe these can then be expressed even as discrete domains (in certain CRON dialects at least). RangeSet would be universal way to describe the various special characters such as * meaning This might be not a good idea because there is certainly a reason why Interval didn't make to jdk8 (ambiguous situations perhaps or then it just wasn't generic enough) and maybe I'm trying to reincarnate a bad idea here, but I think I'll be giving it a shot at one point. |
@TuomasKiviaho this can be done. We could provide a bound for past/future execution times, calculate time between them and provide a set of ranges. May we ask you for further clarification on two subjects?
|
I'm actually not that interested in actually calculating the past nor future execution times.
My use case is actually a conversion from CRON representation to a RangeSets that I use to build SQL like queries against POJOs using QueryDSL. Both SQL and QueryDSL have functions for year, month, day, hour, minute and second that also compose the internal fields of Cron class. If I'd turn the RangeSets representing these fields to pure values in form of
Due to the latter I'd be needing a set per Cron field. This would of course make it harder to do CRON1 intersect|union|negation|... CRON2 style operations, but I guess that's what a new RangeSet capable ExecutionBuilder could be made for. I've also got a separate notion of valid-time start/stop similar to |
@TuomasKiviaho this is a very interesting case. We would like to include such a functionality. May we ask you to take the lead? Perhaps we can do a quick draft implementation and start iterating. Thank you for the proposal! |
We created branch rangeset-support to develop this feature. |
@TuomasKiviaho the feature is implemented! Will be deployed soon! Thanks! 😄 |
@TuomasKiviaho the feature was extracted to its own repo, to avoid the Guava dependency at the core library. |
…ndency, since the feature was extracted to its own repo.
@TuomasKiviaho release 7.0.2 is now available! Thank you for contributing to cron-utils! |
I'd like to use CRON as a compact human readable expression of RangeSet. This would give me possibility to overcome problems if I'd be treating time as DiscreteDomain.
Would it (even) be possible to convert CRON to RangeSet. Vice versa would (probably) also be possible but the rangeset would probably have to forego some sort of analyzer that normalizes it to a more compact form using negations etc.
The text was updated successfully, but these errors were encountered: