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

Create engine outside #9989

Merged
merged 10 commits into from
Aug 5, 2022
Merged

Create engine outside #9989

merged 10 commits into from
Aug 5, 2022

Conversation

Zelldon
Copy link
Member

@Zelldon Zelldon commented Aug 4, 2022

Description

Create the engine outside of the StreamProcessor, which should allow to also inject other RecordProcessors.
Furthermore we can fill the Engine with the needed TypedRecordProcessorFactory, which means we no longer need that in our builders and contexts.

I hope this helps you in make further progress @deepthidevaki

Sidenote:

This also simplifies the StreamProcessor/RecordProcessor tests, since we do not necessarily need to set up so much anymore.

Related issues

related to #9725

Definition of Done

Not all items need to be done depending on the issue and the pull request.

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.

The streamprocessor builder accepts an RecordProcessor useful to add other RecordProcessors
With creating the engine outside the stream processor we can fill it with all necessary dependency and we no longer need these in the builders and contexts
@github-actions
Copy link
Contributor

github-actions bot commented Aug 4, 2022

Test Results

   810 files  ±    0     810 suites  ±0   1h 37m 4s ⏱️ -49s
6 033 tests  - 211  6 022 ✔️  - 213  11 💤 +2  0 ±0 
6 221 runs   - 211  6 210 ✔️  - 213  11 💤 +2  0 ±0 

Results for commit fae722d. ± Comparison against base commit d80629f.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@deepthidevaki deepthidevaki left a comment

Choose a reason for hiding this comment

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

🚀 Exactly what I wanted 😄 Just some minor comment.

@@ -21,7 +20,7 @@
import java.util.List;
import java.util.function.Function;

public final class EngineContext {
public final class RecordProcessorContext {
Copy link
Contributor

Choose a reason for hiding this comment

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

❌ : Can be moved to package io.camunda.zeebe.engine.api. as this is should not be owned by the "engine".
Or better define an interface in io.camunda.zeebe.engine.api and have the implementation in io.camunda.zeebe.streamprocessor

🔧 You can make it a record.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see that as blocker since we are not done yet but sure can do tomorrow.

@@ -127,11 +128,11 @@ private static StreamProcessor createStreamProcessor(
.logStream(context.getLogStream())
.actorSchedulingService(context.getActorSchedulingService())
.zeebeDb(context.getZeebeDb())
.recordProcessor(new Engine(context.getStreamProcessorFactory()))
Copy link
Member Author

Choose a reason for hiding this comment

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

🔧 I guess we should rename the factory here

@@ -21,7 +20,7 @@
import java.util.List;
import java.util.function.Function;

public final class EngineContext {
public final class RecordProcessorContext {
Copy link
Member Author

Choose a reason for hiding this comment

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

I don't see that as blocker since we are not done yet but sure can do tomorrow.

@Zelldon
Copy link
Member Author

Zelldon commented Aug 5, 2022

@deepthidevaki I moved the implementation and introduced a new interface. Could you review again? Maybe you trust me next time 😁 so I can just go ahead and merge after the changes :)

@deepthidevaki
Copy link
Contributor

@deepthidevaki I moved the implementation and introduced a new interface. Could you review again? Maybe you trust me next time grin so I can just go ahead and merge after the changes :)

😕 I didn't know that we now approve and request changes at the same time.

Copy link
Contributor

@deepthidevaki deepthidevaki left a comment

Choose a reason for hiding this comment

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

Thanks.

Comment on lines +87 to +88
recordProcessorContext.setStreamProcessorListener(
typedProcessorContext.getStreamProcessorListener());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [RecordProcessorContext.setStreamProcessorListener](1) should be avoided because it has been deprecated.
@Zelldon
Copy link
Member Author

Zelldon commented Aug 5, 2022

Since this was only something minor I thought so :) https://github.com/camunda/zeebe/blob/main/CONTRIBUTING.md#reviewing-a-pull-request

@Zelldon
Copy link
Member Author

Zelldon commented Aug 5, 2022

bors r+

zeebe-bors-camunda bot added a commit that referenced this pull request Aug 5, 2022
9989: Create engine outside r=Zelldon a=Zelldon

## Description

Create the engine outside of the StreamProcessor, which should allow to also inject other RecordProcessors.
Furthermore we can fill the Engine with the needed TypedRecordProcessorFactory, which means we no longer need that in our builders and contexts.

I hope this helps you in make further progress `@deepthidevaki` 


Sidenote:

This also simplifies the StreamProcessor/RecordProcessor tests, since we do not necessarily need to set up so much anymore.
<!-- Please explain the changes you made here. -->

## Related issues

<!-- Which issues are closed by this PR or are related -->

related to #9725



Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@Zelldon
Copy link
Member Author

Zelldon commented Aug 5, 2022

bors r+

@Zelldon Zelldon mentioned this pull request Aug 5, 2022
10 tasks
zeebe-bors-camunda bot added a commit that referenced this pull request Aug 5, 2022
9989: Create engine outside r=Zelldon a=Zelldon

## Description

Create the engine outside of the StreamProcessor, which should allow to also inject other RecordProcessors.
Furthermore we can fill the Engine with the needed TypedRecordProcessorFactory, which means we no longer need that in our builders and contexts.

I hope this helps you in make further progress `@deepthidevaki` 


Sidenote:

This also simplifies the StreamProcessor/RecordProcessor tests, since we do not necessarily need to set up so much anymore.
<!-- Please explain the changes you made here. -->

## Related issues

<!-- Which issues are closed by this PR or are related -->

related to #9725



10012: refactor: let `dist` build the actor scheduler for gateway r=oleschoenburg a=oleschoenburg

## Description

This moves the responsibility of creating an actor scheduler for the gateway to the `dist` module. As an added benefit, this allows us to remove some redundant constructors, simplify BrokerClient to never start the actor scheduler and a deprecated method from `BrokerStartupContext`.

## Related issues

<!-- Which issues are closed by this PR or are related -->

relates to #9996 



Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
Co-authored-by: Ole Schönburg <ole.schoenburg@gmail.com>
@zeebe-bors-camunda
Copy link
Contributor

This PR was included in a batch that was canceled, it will be automatically retried

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit e751fd6 into main Aug 5, 2022
@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot deleted the zell-create-engine-outside branch August 5, 2022 14:34
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