-
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.
9844: Shape legacy code into new interfaces good bits part 2 r=pihme a=pihme ## Description - Move logic to select processor into engine - Move processing logic into engine - Use `ProcessingResult` to return response and execute side effects - Move error handling logic into engine - Fix tests ## Review Hints - most of the commits have some failing tests - this was unavoidable, because substeps in the modification were invalid/incomplete - In the end, all tests are now passing again. This was quite satisfying acutally - adding more changes and seeing the test failure count go down again - Overall I would say we are through the valley of pain. Was quite volatile recently, but I am confident we can bring some calmness back to development - This achieves that most of the engine abstraction classes are in play; and the division of labor is largely as intended. - Still lots of stuff to do on either side, though ## Related issues related to #9725 Co-authored-by: pihme <pihme@users.noreply.github.com>
- Loading branch information
Showing
17 changed files
with
253 additions
and
125 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
33 changes: 33 additions & 0 deletions
33
engine/src/main/java/io/camunda/zeebe/engine/api/EmptyProcessingResult.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,33 @@ | ||
/* | ||
* 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.CommandResponseWriter; | ||
import io.camunda.zeebe.logstreams.log.LogStreamBatchWriter; | ||
|
||
public final class EmptyProcessingResult implements ProcessingResult { | ||
|
||
public static final ProcessingResult INSTANCE = new EmptyProcessingResult(); | ||
|
||
private EmptyProcessingResult() {} | ||
|
||
@Override | ||
public long writeRecordsToStream(final LogStreamBatchWriter logStreamBatchWriter) { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public boolean writeResponse(final CommandResponseWriter commandResponseWriter) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean executePostCommitTasks() { | ||
return true; | ||
} | ||
} |
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
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
25 changes: 25 additions & 0 deletions
25
engine/src/main/java/io/camunda/zeebe/streamprocessor/ErrorHandlingContextImpl.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,25 @@ | ||
/* | ||
* 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.streamprocessor; | ||
|
||
import io.camunda.zeebe.engine.api.ErrorHandlingContext; | ||
import io.camunda.zeebe.engine.api.ProcessingResultBuilder; | ||
|
||
final class ErrorHandlingContextImpl implements ErrorHandlingContext { | ||
|
||
private final ProcessingResultBuilder processingResultBuilder; | ||
|
||
ErrorHandlingContextImpl(final ProcessingResultBuilder processingResultBuilder) { | ||
this.processingResultBuilder = processingResultBuilder; | ||
} | ||
|
||
@Override | ||
public ProcessingResultBuilder getProcessingResultBuilder() { | ||
return processingResultBuilder; | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
engine/src/main/java/io/camunda/zeebe/streamprocessor/ProcessingContextImpl.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,25 @@ | ||
/* | ||
* 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.streamprocessor; | ||
|
||
import io.camunda.zeebe.engine.api.ProcessingContext; | ||
import io.camunda.zeebe.engine.api.ProcessingResultBuilder; | ||
|
||
final class ProcessingContextImpl implements ProcessingContext { | ||
|
||
private final ProcessingResultBuilder processingResultBuilder; | ||
|
||
ProcessingContextImpl(final ProcessingResultBuilder processingResultBuilder) { | ||
this.processingResultBuilder = processingResultBuilder; | ||
} | ||
|
||
@Override | ||
public ProcessingResultBuilder getProcessingResultBuilder() { | ||
return processingResultBuilder; | ||
} | ||
} |
Oops, something went wrong.