-
Notifications
You must be signed in to change notification settings - Fork 51
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
Convert interval parameter to cron schedule for self serve replication #238
Merged
chenselena
merged 6 commits into
linkedin:main
from
chenselena:selchen/add-cron-schedule-to-replication
Oct 31, 2024
Merged
Convert interval parameter to cron schedule for self serve replication #238
chenselena
merged 6 commits into
linkedin:main
from
chenselena:selchen/add-cron-schedule-to-replication
Oct 31, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chenselena
force-pushed
the
selchen/add-cron-schedule-to-replication
branch
from
October 24, 2024 22:30
4d32593
to
8d864e1
Compare
chenselena
changed the title
Convert interval input to cron schedule for self serve replication
Convert interval parameter to cron schedule for self serve replication
Oct 24, 2024
chenselena
force-pushed
the
selchen/add-cron-schedule-to-replication
branch
3 times, most recently
from
October 25, 2024 15:49
3653da3
to
8791b33
Compare
chenselena
force-pushed
the
selchen/add-cron-schedule-to-replication
branch
from
October 25, 2024 16:46
8791b33
to
3a197f1
Compare
chenselena
commented
Oct 25, 2024
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/CronScheduleGenerator.java
Outdated
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/CronScheduleGenerator.java
Outdated
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/CronScheduleGenerator.java
Outdated
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/CronScheduleGenerator.java
Outdated
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/CronScheduleGenerator.java
Outdated
Show resolved
Hide resolved
chenselena
force-pushed
the
selchen/add-cron-schedule-to-replication
branch
from
October 28, 2024 21:46
e0b7e26
to
040cb01
Compare
chenselena
force-pushed
the
selchen/add-cron-schedule-to-replication
branch
from
October 28, 2024 21:47
040cb01
to
d5ab815
Compare
...ain/java/com/linkedin/openhouse/tables/api/spec/v0/request/components/ReplicationConfig.java
Outdated
Show resolved
Hide resolved
...ain/java/com/linkedin/openhouse/tables/api/spec/v0/request/components/ReplicationConfig.java
Outdated
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/IntervalToCronConverter.java
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/IntervalToCronConverter.java
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/IntervalToCronConverter.java
Show resolved
Hide resolved
services/tables/src/main/java/com/linkedin/openhouse/tables/utils/IntervalToCronConverter.java
Show resolved
Hide resolved
rohitkum2506
approved these changes
Oct 31, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Selena.
abhisheknath2011
approved these changes
Oct 31, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chenselena for addressing the comments!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds cron schedule to the replication config for the self serve replication API and converts the interval parameter to a cron schedule. Cron schedule is needed as an input for the replication job that performs the cross cluster data copy. The library
cronutils
is added to perform the cron expression generation.The interval parameter can be validated as
12H
,1D
,2D
,3D
and the cron schedule is generated based on:Examples of:
12H:
0 15 23/12 ? * * *
1D:
0 45 10 ? * * *
2D:
0 30 8 ? * */2 *
3D:
0 0 8 ? * */3 *
Changes
For all the boxes checked, please include additional details of the changes made in this pull request.
Testing Done
For all the boxes checked, include a detailed description of the testing done for the changes made in this pull request.
Unit tests added to check that the cron schedule was created successfully.
POST http://localhost:8000/v1/databases/u_tableowner/tables for a 1D schedule:
response:
12H schedule:
Additional Information
For all the boxes checked, include additional details of the changes made in this pull request.