-
Notifications
You must be signed in to change notification settings - Fork 113
feat(operator): sleep operator #3537
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
Conversation
…or/sklearn/training/SklearnTrainingOpDesc.scala Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
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.
Pull Request Overview
Introduces a new Sleep operator that pauses processing of each tuple for a configurable duration.
- Adds
SleepOpDescto describe the operator and register it in the logical plan. - Implements
SleepOpExecto apply a blocking delay on each tuple. - Updates
LogicalOpto includeSleepOpDescin the operator registry.
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpExec.scala | Implements blocking delay logic in processTuple |
| core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpDesc.scala | Defines operator descriptor with JSON schema and exec metadata |
| core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/LogicalOp.scala | Registers SleepOpDesc in the global operator registry |
Comments suppressed due to low confidence (3)
core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpDesc.scala:34
- [nitpick] The JSON schema title
"n"is vague. Rename it to"time"or"seconds"so it aligns with thetimefield and improves generated API documentation.
@JsonSchemaTitle("n")
core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpDesc.scala:61
- [nitpick] The operator description refers to
n seconds, but the parameter is namedtime. Update the description to mentiontime(e.g., "Sleeptimeseconds between each tuple") for consistency.
"Sleep n seconds between each tuple",
core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpDesc.scala:31
- There are no tests covering the new Sleep operator. Consider adding unit or integration tests to verify the configured delay and ensure correct operator behavior under various
timevalues.
class SleepOpDesc extends LogicalOp {
core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpExec.scala
Outdated
Show resolved
Hide resolved
Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
Yicong-Huang
left a comment
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.
This operator can be confusing to users. I do not recommend adding it to master. If you really want it, please hide the UI so it can be only searched out, not dragged out.
core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpDesc.scala
Outdated
Show resolved
Hide resolved
core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpExec.scala
Show resolved
Hide resolved
core/workflow-operator/src/main/scala/edu/uci/ics/amber/operator/sleep/SleepOpDesc.scala
Show resolved
Hide resolved
It's now hidden in the operator menu. |
Signed-off-by: Xinyuan Lin <xinyual3@uci.edu>
Introduce a sleep operator that adds a configurable delay between tuples. This can be useful during the development or testing of the workflow to simulate long-running tasks or processing delays.
It's not visible on the operator panel and will only appear when searched for.