-
Notifications
You must be signed in to change notification settings - Fork 0
feat(java): workflow fan-out / fan-in #306
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
aff761c
feat(java): bind fan-out/fan-in workflow primitives over JNI
pratyush618 1aa42ce
feat(java): expose fan-out native methods on the backend SPI
pratyush618 10d6cc0
feat(java): add fan-out/fan-in to the workflow builder
pratyush618 469ac00
feat(java): drive fan-out/fan-in from a stateful tracker
pratyush618 d9a7618
test(java): cover fan-out/fan-in execution
pratyush618 09d1bb8
docs(java): document fan-out/fan-in
pratyush618 39f529e
refactor(java): make workflow SPI methods default-throwing
pratyush618 2390983
fix(java): validate fan-out/fan-in step construction
pratyush618 5113eb3
fix(java): harden fan-out/fan-in routing (all successors, empty produ…
pratyush618 927eaad
fix(java): order fan-out children by item index
pratyush618 8c5a6e2
docs(java): clarify trackWorkflows is required per worker
pratyush618 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
59 changes: 59 additions & 0 deletions
59
sdks/java/src/main/java/org/byteveda/taskito/workflows/PlanNode.java
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| package org.byteveda.taskito.workflows; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonCreator; | ||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
| import com.fasterxml.jackson.annotation.JsonProperty; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
|
|
||
| /** One node of a run's plan: predecessors plus the metadata needed to enqueue deferred work. */ | ||
| @JsonIgnoreProperties(ignoreUnknown = true) | ||
| final class PlanNode { | ||
| final String name; | ||
| final List<String> predecessors; | ||
| final String taskName; | ||
| final String queue; | ||
| final Integer maxRetries; | ||
| final Long timeoutMs; | ||
| final Integer priority; | ||
| final String fanOut; | ||
| final String fanIn; | ||
|
|
||
| @JsonCreator | ||
| PlanNode( | ||
| @JsonProperty("name") String name, | ||
| @JsonProperty("predecessors") List<String> predecessors, | ||
| @JsonProperty("taskName") String taskName, | ||
| @JsonProperty("queue") String queue, | ||
| @JsonProperty("maxRetries") Integer maxRetries, | ||
| @JsonProperty("timeoutMs") Long timeoutMs, | ||
| @JsonProperty("priority") Integer priority, | ||
| @JsonProperty("fanOut") String fanOut, | ||
| @JsonProperty("fanIn") String fanIn) { | ||
| this.name = name; | ||
| this.predecessors = predecessors == null ? Collections.emptyList() : predecessors; | ||
| this.taskName = taskName; | ||
| this.queue = queue; | ||
| this.maxRetries = maxRetries; | ||
| this.timeoutMs = timeoutMs; | ||
| this.priority = priority; | ||
| this.fanOut = fanOut; | ||
| this.fanIn = fanIn; | ||
| } | ||
|
|
||
| int retries() { | ||
| return maxRetries == null ? 3 : maxRetries; | ||
| } | ||
|
|
||
| long timeout() { | ||
| return timeoutMs == null ? 300_000L : timeoutMs; | ||
| } | ||
|
|
||
| int priorityOrDefault() { | ||
| return priority == null ? 0 : priority; | ||
| } | ||
|
|
||
| String queueOrDefault() { | ||
| return queue == null ? "default" : queue; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.