Skip to content
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

[GOBBLIN-1895] Set default trigger event time for adhoc flows orchestration in multi… #3759

Merged

Conversation

umustafi
Copy link
Contributor

@umustafi umustafi commented Sep 1, 2023

…-active case

Dear Gobblin maintainers,

Please accept this PR. I understand that it will not be reviewed until I have checked off all the steps below!

JIRA

Description

Tests

  • My PR adds the following unit tests OR does not need testing for this extremely good reason:

Commits

  • My commits all reference JIRA issues in their subject lines, and I have squashed multiple commits if they address the same issue. In addition, my commits follow the guidelines from "How to write a good git commit message":
    1. Subject is separated from body by a blank line
    2. Subject is limited to 50 characters
    3. Subject does not end with a period
    4. Subject uses the imperative mood ("add", not "adding")
    5. Body wraps at 72 characters
    6. Body explains "what" and "why", not "how"

@umustafi umustafi changed the title Set default trigger event time for adhoc flows orchestration in multi… [GOBBLIN-1895] Set default trigger event time for adhoc flows orchestration in multi… Sep 1, 2023
Comment on lines 252 to 253
// If triggerTimestampMillis is -1, then it was not set by the job trigger handler, and we cannot handle this event
if (triggerTimestampMillis == -1L) {
Copy link
Contributor

Choose a reason for hiding this comment

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

seems fine to adopt -1 as a sentinel value for "never set".

(I'm presuming we're only doing it because it would be a more far reaching rework to use Optional<Long>, which would most clearly capture the situation.)

still, let's give this constant a name to describe its meaning. e.g.TRIGGER_EVENT_TIME_NEVER_SET

@@ -491,7 +491,7 @@ public void runJob(Properties jobProps, JobListener jobListener) throws JobExcep
try {
Spec flowSpec = this.scheduledFlowSpecs.get(jobProps.getProperty(ConfigurationKeys.JOB_NAME_KEY));
String triggerTimestampMillis = jobProps.getProperty(
ConfigurationKeys.ORCHESTRATOR_TRIGGER_EVENT_TIME_MILLIS_KEY, "0");
ConfigurationKeys.ORCHESTRATOR_TRIGGER_EVENT_TIME_MILLIS_KEY, "-1");
Copy link
Contributor

Choose a reason for hiding this comment

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

if this should "never happen", maybe a comment just above, expressing that it should always be set... and if ever not, the orchestrator will fail the flow.

@@ -249,8 +251,8 @@ public void orchestrate(Spec spec, Properties jobProps, long triggerTimestampMil
// If multi-active scheduler is enabled do not pass onto DagManager, otherwise scheduler forwards it directly
// Skip flow compilation as well, since we recompile after receiving event from DagActionStoreChangeMonitor later
if (flowTriggerHandler.isPresent()) {
// If triggerTimestampMillis is 0, then it was not set by the job trigger handler, and we cannot handle this event
if (triggerTimestampMillis == 0L) {
// If triggerTimestampMillis is -1, then it was not set by the job trigger handler, and we cannot handle this event
Copy link
Contributor

@phet phet Sep 1, 2023

Choose a reason for hiding this comment

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

delete "-1, then it was "?

and s/and/then/

@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2023

Codecov Report

Merging #3759 (3753433) into master (10b6eb2) will increase coverage by 0.05%.
Report is 1 commits behind head on master.
The diff coverage is 50.00%.

@@             Coverage Diff              @@
##             master    #3759      +/-   ##
============================================
+ Coverage     47.09%   47.14%   +0.05%     
- Complexity    10876    10893      +17     
============================================
  Files          2147     2148       +1     
  Lines         84925    85039     +114     
  Branches       9420     9438      +18     
============================================
+ Hits          39992    40091      +99     
- Misses        41299    41307       +8     
- Partials       3634     3641       +7     
Files Changed Coverage Δ
...pache/gobblin/configuration/ConfigurationKeys.java 0.00% <ø> (ø)
...in/service/modules/orchestration/Orchestrator.java 51.08% <0.00%> (+0.54%) ⬆️
.../modules/scheduler/GobblinServiceJobScheduler.java 69.02% <100.00%> (+0.08%) ⬆️

... and 8 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@Will-Lo Will-Lo merged commit 673773a into apache:master Sep 1, 2023
6 checks passed
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.

4 participants