-
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
Separate StreamProcessorContext
and TypedRecordProcessorContext
#9826
Separate StreamProcessorContext
and TypedRecordProcessorContext
#9826
Conversation
…cordProcessorContext This is to separate the two contexts. One is used for the stream processor, the other in the engine. This is an intermediate step where the engine upon initializing returns objects that are still needed in the stream processor context. SOme will disappear once the engine abstraction refactoring is complete. Others may require additional refactoring later on.
@@ -128,8 +128,6 @@ private void validate() { | |||
Objects.requireNonNull(typedRecordProcessorFactory, "No stream processor factory provided."); | |||
Objects.requireNonNull(actorSchedulingService, "No task scheduler provided."); | |||
Objects.requireNonNull(streamProcessorContext.getLogStream(), "No log stream provided."); | |||
Objects.requireNonNull( |
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.
This line was removed due to lifecycle changes (i.e. the field will now be set at a later time).
recordProcessorContext.getScheduleService(), | ||
recordProcessorContext.getZeebeDb(), | ||
recordProcessorContext.getTransactionContext(), | ||
recordProcessorContext.getStreamWriterProxy(), |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
recordProcessorContext.getTransactionContext(), | ||
recordProcessorContext.getStreamWriterProxy(), | ||
recordProcessorContext.getEventApplierFactory(), | ||
recordProcessorContext.getTypedResponseWriter()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
recordProcessorContext.setStreamProcessorListener( | ||
typedProcessorContext.getStreamProcessorListener()); | ||
|
||
recordProcessorContext.setLifecycleListeners(typedRecordProcessors.getLifecycleListeners()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
recordProcessorContext.setLifecycleListeners(typedRecordProcessors.getLifecycleListeners()); | ||
final RecordProcessorMap recordProcessorMap = typedRecordProcessors.getRecordProcessorMap(); | ||
|
||
recordProcessorContext.setRecordProcessorMap(recordProcessorMap); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
final RecordProcessorMap recordProcessorMap = typedRecordProcessors.getRecordProcessorMap(); | ||
|
||
recordProcessorContext.setRecordProcessorMap(recordProcessorMap); | ||
recordProcessorContext.setWriters(typedProcessorContext.getWriters()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
typedRecordProcessorFactory); | ||
engine.init(recordProcessorContext); | ||
|
||
lifecycleAwareListeners.addAll(recordProcessorContext.getLifecycleListeners()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
engine.init(recordProcessorContext); | ||
|
||
lifecycleAwareListeners.addAll(recordProcessorContext.getLifecycleListeners()); | ||
streamProcessorContext.recordProcessorMap(recordProcessorContext.getRecordProcessorMap()); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
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.
👍
- 💭 Would be great if we could turn all these context objects into immutable objects, I think. It would make reasoning about the system simpler, and would allow us to turn them in light
record
s.
engine/src/main/java/io/camunda/zeebe/streamprocessor/StreamProcessorContext.java
Show resolved
Hide resolved
Sound good, but not quite possible as of now |
bors merge |
Build succeeded: |
Description
setWriters()
), which is a bit of a smell. Some of the information flows will be removed by further refactoring.Related issues
closes #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.