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

Isolate shared RecordStreamSource functionality #193

Merged
merged 6 commits into from
Feb 22, 2022

Conversation

remcowesterhoud
Copy link
Contributor

@remcowesterhoud remcowesterhoud commented Feb 17, 2022

Description

The RecordStreamSource interface defines a lot of methods that generic and should be reusable. This PR creates a new RecordStream class in the filters module. This class will implement these generic functions, so not all RecordStreamSource classes have to implement them separately, preventing duplication.

It's quite a refactoring so I've done it in a few steps to make it easier to review:

  1. Create the RecordStream class containing the shared functionality.
  2. Remove the shared functionality from the RecordStreamSource interface and the implementation.
  3. Use the new RecordStream class in the engine module.
  4. Make the filters in the filters module use the new RecordStream class.
  5. Switch the RecordStreamSource to the new RecordStream in the other modules.

In Zeebe we have a similar functionality in the RecordingExporter. It would be nice if we could share this functionality between the 2 projects at some time. We can't use the zeebe implementation at the moment because it is not Java 8 compatible.

Related issues

This is a requirement for #192 . Without doing this #192 would introduce a lot of duplication as it needs create an implementation of the RecordStreamSource interface.

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

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

@github-actions
Copy link

github-actions bot commented Feb 17, 2022

Unit Test Results

  90 files    90 suites   4m 17s ⏱️
192 tests 192 ✔️ 0 💤 0
576 runs  576 ✔️ 0 💤 0

Results for commit e388110.

♻️ This comment has been updated with latest results.

Copy link
Member

@saig0 saig0 left a comment

Choose a reason for hiding this comment

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

@remcowesterhoud looks good 🚀

I have just a small suggestion. Please have a look before merging.

Creates a new RecordStream class which contains the common functionality that was part of the RecordStreamSourceImpl.
This is necessary because we will have different implementations of RecordSource and we don't want to implement these shared functions between all of them.
Removes the shared functionality from the RecordStreamSource. These functionalities have been moved to RecordStream. RecordStreamSource is only responsible for providing records (it is the source of the records).
The engine will no longer have he option to filter records by default in the RecordStreamSource. Because of this we need to wrap the RecordStreamSource into a RecordStream in places we want to use these filters. For this a dependency on the filters module is required.
…ource

The functionality used by the filters was removed from RecordStreamSource and placed in the new RecordStream class. Therefore, the filters should now use a RecordStream instead of a RecordStreamSource.
Places that used a RecordStreamSource before should now be using the new RecordStream.
This constructor is never accessed outside of this class. Other classes all use RecordStream.of().
@remcowesterhoud remcowesterhoud merged commit 29ae84a into main Feb 22, 2022
@remcowesterhoud remcowesterhoud deleted the separate-recordstream branch February 22, 2022 08:58
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.

2 participants