-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
9853: Engine abstraction - rewrite Writers class to use ResultProcessorBuilder provided by platform r=pihme a=pihme ## Description This is the last PR in the "shape legacy code into new interfaces" series. Previously, the new interfaces `ProcessingResultBuilder` and `ProcessingResult` were introduced. This is how the engine is supposed to return the processing result to the stream processor. Also previously, these classes were passed between stream processor and engine on interface level, and the division of labor between stream processor and engine was established. What was not achieved yet, is that the engine uses these new classes. Instead, the engine used existing legacy code to circumvent the new interfaces. This PR transforms the engine to use the new classes provided by the stream processor: - Central point of transformation is the `Writers` class which at the outset depended on stream writers, state writers, response writers and so on - In the end, the `Writers` class only depends on `ProcessingResultBuilder` which will be swapped out for each record processed, or each error to be handled - To make this transition possible we a) need to refine the `Typed(Response/Rejection/Command)Writer` classes and remove methods like `reset, flush` which will no longer be offered by the new interfaces and b) need to implement the refined interfaces with an implementation that forwards calls to `ProcessingResultBuilder` ## Review hints - `@npepinpe` 95% of changes is in the engine, `@remcowesterhoud` will look into those - These changes are done under "better done than perfect" regime. Some naming might be not exactly right. Some clean up might be done after the fact. The focus is to establish much of the engine abstraction concept, so that both teams afterwards can work without interfering with each other. ## Related issues related to #9725 Co-authored-by: pihme <pihme@users.noreply.github.com>
- Loading branch information
Showing
70 changed files
with
903 additions
and
409 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
engine/src/main/java/io/camunda/zeebe/engine/api/LegacyTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH under | ||
* one or more contributor license agreements. See the NOTICE file distributed | ||
* with this work for additional information regarding copyright ownership. | ||
* Licensed under the Zeebe Community License 1.1. You may not use this file | ||
* except in compliance with the Zeebe Community License 1.1. | ||
*/ | ||
package io.camunda.zeebe.engine.api; | ||
|
||
import io.camunda.zeebe.engine.processing.streamprocessor.writers.LegacyTypedCommandWriter; | ||
|
||
/** This interface is here to migrate legacy tasks */ | ||
@Deprecated | ||
public interface LegacyTask { | ||
|
||
void run(LegacyTypedCommandWriter commandWriter, ProcessingScheduleService schedulingService); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.