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

Refactor and Move ProcessorContext #9743

Merged
merged 4 commits into from
Jul 8, 2022

Conversation

pihme
Copy link
Contributor

@pihme pihme commented Jul 8, 2022

Description

  • Rename (ReadOnly)ProcessorContext to StreamProcessorContext
  • Move interface to api package, move implementation to streamprocessor package
  • Simplifiy code

Related issues

related to #9725

Definition of Done

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

pihme added 4 commits July 8, 2022 12:28
Moves StreamProcessorContext into ..zeebe.streamprocessors package as this is the context object for the platform part.
Adds a new RecordProcessorContext interface to capture the information that is needed by record processors. This is to later thin out StreamProcessorContext.

For now, however StreamProcessorContext simply implements that interface to keep the changes minimal.

Once the engine abstraction is established, each time can continue refactoring their halfs of the interface
This commit moves two interfaces to the API package. The API package is meant to contain the public API of the engine. Both of these interfaces are implemented outside the engine.

Other interfaces may also need to be moved there, but the current focus is on ReadonlyStreamProcessorContext, StreamProcessorLifecycleAware was also moved, because it depends on ReadonlyStreamProcessorContext and is implemented in the broker
Previously, this interface was designed by following the rule "This interface has read only methods for everything in StreamProcessorContext". This is now changed to "This interface has everything that is actually needed." The switch was made, because StreamProcessorContext has grown quite large and we want to reduce its size. With this change, we can better see, which information is actually needed by clients of the interface.

Also, we were able to remove some stuff from StreamProcessorContext which was not used
@pihme pihme requested a review from npepinpe July 8, 2022 11:12
@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

Unit Test Results

   788 files  ±  0     788 suites  ±0   1h 35m 43s ⏱️ +37s
6 153 tests +35  6 146 ✔️ +35  7 💤 ±0  0 ±0 
6 322 runs  +35  6 315 ✔️ +35  7 💤 ±0  0 ±0 

Results for commit cbcf66e. ± Comparison against base commit c0cf068.

Copy link
Member

@npepinpe npepinpe left a comment

Choose a reason for hiding this comment

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

👍 Love seeing the context classes split

@pihme
Copy link
Contributor Author

pihme commented Jul 8, 2022

bors merge

zeebe-bors-camunda bot added a commit that referenced this pull request Jul 8, 2022
9743: Refactor and Move `ProcessorContext` r=pihme a=pihme

## Description

* Rename `(ReadOnly)ProcessorContext` to  `StreamProcessorContext`
* Move interface to `api` package, move implementation to `streamprocessor` package
* Simplifiy code

## Related issues

related to #9725 



Co-authored-by: pihme <pihme@users.noreply.github.com>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@pihme
Copy link
Contributor Author

pihme commented Jul 8, 2022

bors retry

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 2fec923 into main Jul 8, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the 9725-engine-abstraction-part-2 branch July 8, 2022 13:03
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.

None yet

2 participants