Skip to content

Conversation

@aglinxinyuan
Copy link
Contributor

@aglinxinyuan aglinxinyuan commented Jul 7, 2025

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.

@aglinxinyuan aglinxinyuan self-assigned this Jul 7, 2025
Copilot AI review requested due to automatic review settings July 7, 2025 01:55
@github-project-automation github-project-automation bot moved this to In Progress in Control Block Jul 7, 2025
@aglinxinyuan aglinxinyuan changed the base branch from master to xinyuan-sk-training July 7, 2025 01:56
Copy link
Contributor

Copilot AI left a 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 SleepOpDesc to describe the operator and register it in the logical plan.
  • Implements SleepOpExec to apply a blocking delay on each tuple.
  • Updates LogicalOp to include SleepOpDesc in 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 the time field 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 named time. Update the description to mention time (e.g., "Sleep time seconds 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 time values.
class SleepOpDesc extends LogicalOp {

@aglinxinyuan aglinxinyuan requested a review from Yicong-Huang July 7, 2025 02:01
Copy link
Contributor

@Yicong-Huang Yicong-Huang left a 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.

@aglinxinyuan
Copy link
Contributor Author

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.

It's now hidden in the operator menu.

@aglinxinyuan aglinxinyuan requested a review from Yicong-Huang July 8, 2025 23:28
Base automatically changed from xinyuan-sk-training to master July 11, 2025 20:39
@aglinxinyuan aglinxinyuan changed the title feat(operator): sleep operator feat(operator): sleep operator Jul 11, 2025
@aglinxinyuan aglinxinyuan changed the title feat(operator): sleep operator feat(operator): sleep operator Jul 11, 2025
@aglinxinyuan aglinxinyuan enabled auto-merge (squash) July 11, 2025 22:09
@aglinxinyuan aglinxinyuan merged commit 288a990 into master Jul 11, 2025
11 checks passed
@aglinxinyuan aglinxinyuan deleted the xinyuan-op-sleep branch July 11, 2025 22:14
@github-project-automation github-project-automation bot moved this from In Progress to Done in Control Block Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants