Skip to content
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

Move LastProcessedPositionState to stream processor #9801

Conversation

pihme
Copy link
Contributor

@pihme pihme commented Jul 13, 2022

Description

The last processed position state is only used by the StreamProcessor. Therefore, it
was moved into the streamprocessor package. The existing classes and interfaces were
moved as is. There is probably a way to simplify this code, but this is something we
can still do after the refactoring.

In the tests, minimal effort was undertaken to make the tests pass. The test classes
are very complex and ripe for an overhaul, but this would have increased the change
set considerably.

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:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

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
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

The last processed position state is only used by the StreamProcessor. Therefore, it
was moved into the streamprocessor package. The existing classes and interfaces were
moved as is. There is probably a way to simplify this code, but this is something we
can still do after the refactoring.

In the tests, minimal effort was undertaken to make the tests pass. The test classes
are very complex and ripe for an overhaul, but this would have increased the change
set considerably
@pihme pihme requested a review from npepinpe July 13, 2022 12:06
@pihme
Copy link
Contributor Author

pihme commented Jul 13, 2022

/cc @deepthidevaki relates to the discussion we had about separating the DB state between engine and non-engine


streamProcessorDbState = new StreamProcessorDbState(zeebeDb, transactionContext);
streamProcessorContext.lastProcessedPositionState(
getStreamProcessorDbState().getLastProcessedPositionState());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [StreamProcessor.getStreamProcessorDbState](1) should be avoided because it has been deprecated.
return factory.createProcessors(processingContext);
}));

lastProcessedPositionState = result.getStreamProcessorDbState().getLastProcessedPositionState();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [StreamProcessor.getStreamProcessorDbState](1) should be avoided because it has been deprecated.
return factory.createProcessors(processingContext);
}));

lastProcessedPositionState = result.getStreamProcessorDbState().getLastProcessedPositionState();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [StreamProcessor.getStreamProcessorDbState](1) should be avoided because it has been deprecated.
}),
streamWriterFactory);

lastProcessedPositionState = result.getStreamProcessorDbState().getLastProcessedPositionState();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation

Invoking [StreamProcessor.getStreamProcessorDbState](1) should be avoided because it has been deprecated.
@github-actions
Copy link
Contributor

Unit Test Results

   791 files  ±  0     791 suites  ±0   1h 37m 59s ⏱️ - 3m 38s
6 202 tests +23  6 195 ✔️ +23  7 💤 ±0  0 ±0 
6 371 runs  +23  6 364 ✔️ +23  7 💤 ±0  0 ±0 

Results for commit 49faab2. ± Comparison against base commit b005273.

Copy link
Member

@npepinpe npepinpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

  • 👍 Love seeing the state interface get smaller/split up

Just a small suggestion, mostly for future things.

@pihme
Copy link
Contributor Author

pihme commented Jul 18, 2022

bors merge

zeebe-bors-camunda bot added a commit that referenced this pull request Jul 18, 2022
9801: Move `LastProcessedPositionState` to stream processor r=pihme a=pihme

## Description
The last processed position state is only used by the StreamProcessor. Therefore, it
was moved into the streamprocessor package. The existing classes and interfaces were
moved as is. There is probably a way to simplify this code, but this is something we
can still do after the refactoring.

In the tests, minimal effort was undertaken to make the tests pass. The test classes
are very complex and ripe for an overhaul, but this would have increased the change
set considerably.

## Related issues

related to #9725



Co-authored-by: pihme <pihme@users.noreply.github.com>
@zeebe-bors-camunda
Copy link
Contributor

Build failed:

@pihme
Copy link
Contributor Author

pihme commented Jul 18, 2022

bors retry

@zeebe-bors-camunda
Copy link
Contributor

Build succeeded:

@zeebe-bors-camunda zeebe-bors-camunda bot merged commit 2027c06 into main Jul 18, 2022
@zeebe-bors-camunda zeebe-bors-camunda bot deleted the 9725-move-last-processed-position-db-state-to-stream-processor branch July 18, 2022 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants