graylog2-server icon indicating copy to clipboard operation
graylog2-server copied to clipboard

Use MongoCollections in StreamServiceImpl

Open kingzacko1 opened this issue 9 months ago • 1 comments

Description

  • Removes usage of Persisted and PersistedService interfaces from Stream and StreamService implementations
  • Switches to using StreamDTO object as the DB class instead of StreamImpl
  • Removes all usages of StreamImpl in favor of StreamDTO
  • Adds methods to StreamService that only return streams of StreamDTO objects to skip overhead of populating Outputs and StreamRules when they are not needed in calling context

/nocl this should effectively be a refactoring that doesn't change user facing functionality. Will add a CL or UPGRADING.md entry if need be

/prd Graylog2/graylog-plugin-enterprise#10392

Motivation and Context

  • Move away from using deprecated PersistedService to MongoCollections
  • Add ability to scope Streams and move away from hard-coded system stream IDs
  • partially addresses Graylog2/graylog-plugin-enterprise#10284
    • will add ScopedEntity support in a separate PR

How Has This Been Tested?

Dev environment ensuring existing Stream functionality behaves the same, existing unit tests, and ITs.

Screenshots (if appropriate):

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [x] Refactoring (non-breaking change)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [ ] My code follows the code style of this project.
  • [ ] My change requires a change to the documentation.
  • [ ] I have updated the documentation accordingly.
  • [ ] I have read the CONTRIBUTING document.
  • [ ] I have added tests to cover my changes.

kingzacko1 avatar Apr 11 '25 19:04 kingzacko1

@bernd first round of feedback has been addressed. StreamImpl is gone along with setters and the dangerous raw map functions. May be some test cases that still need cleaning up, but from a quick test through the UI seems like Stream functionality is mostly in tact.

kingzacko1 avatar Jun 16 '25 21:06 kingzacko1

Thank you for all of the feedback along the way, @bernd! 🎉

kingzacko1 avatar Jun 27 '25 13:06 kingzacko1