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

Introduce State Related Operators #2858

Draft
wants to merge 225 commits into
base: master
Choose a base branch
from
Draft

Conversation

aglinxinyuan
Copy link
Collaborator

@aglinxinyuan aglinxinyuan commented Sep 21, 2024

This PR introduces State to Data and Data to State operators, enabling users to convert between data and state.

New Operator Groups and Constants:

  • Added STATE_GROUP to OperatorGroupConstants and updated the group hierarchy to include this new group.

New Operators:

  • Implemented DataToState Operator to convert data into state.
  • Implemented StateToData Operator to convert state back into data.

image

The State to Data operator retrieves the first tuple from the first port, converting it into a state while taking all tuples from the second port as data to pass downstream. The user can configure whether the state is passed once or to all downstream operators.

image

The Data to State operator retrieves the first state from the input port, converting it into a tuple and output to the first output port while taking all tuples from the input port as data and output to the second output port. The user has to define the state's scheme.

image

Even though this pair of operators will only take the first tuple/state, it's possible to nest multiple pairs of those operators to convert multiple tuples/states.

image

This pull request introduces a new feature for state management within the workflow system. The changes include adding new operator groups and implementing two new operators: DataToStateOpDesc and StateToDataOpDesc. These operators facilitate the conversion between data and state within workflows.

@aglinxinyuan aglinxinyuan requested review from Yicong-Huang and removed request for Yicong-Huang September 23, 2024 00:48
Base automatically changed from xinyuan-state-passing to master September 24, 2024 05:50
@aglinxinyuan aglinxinyuan removed the request for review from Yicong-Huang September 24, 2024 06:24
@aglinxinyuan aglinxinyuan marked this pull request as draft September 24, 2024 06:30
@aglinxinyuan aglinxinyuan marked this pull request as ready for review September 26, 2024 03:15
@aglinxinyuan aglinxinyuan marked this pull request as draft October 7, 2024 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

2 participants