-
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
Extract Streamprocessor from engine module #10979
Conversation
Split engine module into two separate modules. One called stream-platform which contains everything related to stream processing. This module contains right now the API and implementation. It can and will be splitted further in the future. The other remaining module is still called engine, which contains the record processor implementation. It is the core or business logic of zeebe (the process engine). Implementation classes have been moved and imports are adjusted in this commit. There are several classes which needed to be moved, which we might want to move to a different place later. For example: * ZbColumnFamily * CopiedRecords * RecordValues * etc.
I guess it is best to just check the structure locally. 😁 Or via clicking |
+1,439 −995 ? Instant LGTM ;) I'll try to have a look at it today assuming no medic stuff pops up 🙏 |
engine/src/test/java/io/camunda/zeebe/engine/ArchitectureTest.java
Outdated
Show resolved
Hide resolved
3ec12ba
to
7ae3a25
Compare
In order to decouple the engine from the implementation, we have to duplicate the NextValueManager. We can later simplify this to have maybe something else in use in the keygenerate to reduce the duplication.
cbe2845
to
477b87f
Compare
@npepinpe @oleschoenburg @oleschoenburg someone of you time for a review today? To avoid too much merge conflicts with other PR's 😅 |
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.
👍
engine/src/main/java/io/camunda/zeebe/engine/state/deployment/NextValue.java
Outdated
Show resolved
Hide resolved
*/ | ||
package io.camunda.zeebe.engine.state; | ||
package io.camunda.zeebe.protocol; |
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.
💭 Yes, definitely, this should be moved somewhere else 😄
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.
Do you already have an idea?
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.
OTOH, it wouldn't be that crazy for the whole DB persistence layer to have its own module, e.g. engine-state
or something, then that could go in there. I guess not something we can unilaterally decide. Or it can go in the API module once we have one? Since that will be a dependency for both the stream platform impl and the engine?
I guess in the stream platform module we just need it for the processed position and such things? We don't really access the engine states, right? It would be cool if we could somehow share the DB but not know about the engine state/column families either...like a way to extend the state? We open the DB, create our own state/columns, then pass it on to the engine. They also don't need to know about our own columns/states. Not sure how feasible that is due to how we index though :(
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.
Yeah state module is something I also wanted since a while but still this wouldn't solve it since stream platform doesn't want to know all these details.
What I thought first I could extend an enum, first define the two columns and then later extend in the engine with more columns, but unfortunately enums can't be extended since they are final 😅
Theoretically, we could do something similar via composition I guess, we have some default columns defined on base level which always need to be defined. Call the class BaseColumns these are used by stream-platform, and engine defines own columns and also uses BaseColumns. 🤷 But I felt this is too much for this PR. :)
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.
Yeah that's fair. I think we should do it long term (both the state module and taking the composition approach, so each module doesn't need to know all columns).
...form/src/main/java/io/camunda/zeebe/stream/api/records/ExceededBatchRecordSizeException.java
Show resolved
Hide resolved
stream-platform/src/main/java/io/camunda/zeebe/stream/impl/state/LastProcessedPosition.java
Outdated
Show resolved
Hide resolved
stream-platform/src/test/java/io/camunda/zeebe/stream/util/RecordToWrite.java
Show resolved
Hide resolved
stream-platform/src/test/java/io/camunda/zeebe/stream/util/RecordToWrite.java
Show resolved
Hide resolved
Co-authored-by: Nicolas Pepin-Perreault <43373+npepinpe@users.noreply.github.com>
Co-authored-by: Nicolas Pepin-Perreault <43373+npepinpe@users.noreply.github.com>
bors r+ |
Build succeeded: |
565: Fix code after stream-engine module split r=remcowesterhoud a=Zelldon ## Description Due to recent module split several imports have changed. This has to be adjusted and the event applies are no longer created outside. Should only be merged AFTER camunda/camunda#10979 is merged <!-- Please explain the changes you made here. --> ## Related issues <!-- Which issues are closed by this PR or are related --> closes # <!-- Cut-off marker _All lines under and including the cut-off marker will be removed from the merge commit message_ ## Definition of Ready Please check the items that apply, before requesting a review. You can find more details about these items in our wiki page about [Pull Requests and Code Reviews](https://github.com/camunda-cloud/zeebe/wiki/Pull-Requests-and-Code-Reviews). * [ ] I've reviewed my own code * [ ] I've written a clear changelist description * [ ] I've narrowly scoped my changes * [ ] I've separated structural from behavioural changes --> ## Definition of Done <!-- Please check the items that apply, before merging or (if possible) before requesting a review. --> _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 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 Documentation: * [ ] Javadoc has been written * [ ] The documentation is updated Co-authored-by: Christopher Zell <zelldon91@googlemail.com>
Description
Split the engine module into two separate modules.
One called stream-platform (zeebe-stream-platform), the name is of course discussable, which contains everything related to stream processing. This module contains right now the API and implementation. It can and will be split further in the future.
There is a new package names
io.camunda.stream.api/impl
etc. Here we can also agree on a different name of course.The other remaining module is still called engine, which contains the record processor implementation. It is the core or business logic of zeebe (the process engine). Right now it still depends on some impl classes like CopiedRecords, RecordValues mostly related to tests. This can hopefully be resolved in the future via iteration over the engine tests. #10004
I prepared some structure in the API and impl, but can also be discussed.
There are several classes which have been moved, which we might want
to move to a different place later.
For example:
Related issues
closes #10977
closes #10130
closes #9727
closes #9600
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.