-
Notifications
You must be signed in to change notification settings - Fork 556
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
Create engine outside #9989
Conversation
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
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.
🚀 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 { |
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.
❌ : 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
.
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.
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())) |
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.
🔧 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 { |
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.
I don't see that as blocker since we are not done yet but sure can do tomorrow.
@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 :) |
😕 I didn't know that we now approve and request changes at the same time. |
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.
Thanks.
recordProcessorContext.setStreamProcessorListener( | ||
typedProcessorContext.getStreamProcessorListener()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
Since this was only something minor I thought so :) https://github.com/camunda/zeebe/blob/main/CONTRIBUTING.md#reviewing-a-pull-request |
bors r+ |
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>
Build failed: |
bors r+ |
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>
This PR was included in a batch that was canceled, it will be automatically retried |
Build succeeded: |
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:
backport stable/1.3
) to the PR, in case that fails you need to create backports manually.Testing:
Documentation:
Please refer to our review guidelines.