Skip to content

refactor: replace ScrubberReport enum with optional clustering field … - #15

Merged
admitrievtsev merged 2 commits into
Piletskii-Oleg:mainfrom
Vlm326:refactor/scrubber-measurement-interface
Jul 15, 2026
Merged

refactor: replace ScrubberReport enum with optional clustering field …#15
admitrievtsev merged 2 commits into
Piletskii-Oleg:mainfrom
Vlm326:refactor/scrubber-measurement-interface

Conversation

@Vlm326

@Vlm326 Vlm326 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

…in ScrubMeasurements

Initially I tried to design a new measurement interface using a ScrubberReport enum with Generic and Sbc variants, to cleanly separate basic metrics from clustering-specific data. However, on review it became clear this violates the Open-Closed Principle: adding any new scrubber type like FBC would require modifying the public enum. It also introduces unnecessary abstraction for a codebase that currently has only two scrubber variants. Instead, I replaced the enum with a simple Option field on ScrubMeasurements. CopyScrubber and DumbScrubber return None, while a future SBC scrubber will populate it with Some(...). This way the interface stays a single struct with a single return type, and extension happens by growing ClusteringMeasurements rather than adding enum variants.

@admitrievtsev admitrievtsev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Пойдёт

Comment thread src/lib.rs
use std::time::Duration;

pub use system::database::{Database, IterableDatabase};
pub use system::database::{ContainerDatabase, Database, IterableDatabase};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Чем обусловлено изменение данной строки я не понимаю, в таске про это не сказано ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Это связано с тем что был смерджен пуллреквест и эта строчка была добавлена чтобы избежать конфликта

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

аппрувнут

@admitrievtsev
admitrievtsev merged commit e8ac41b into Piletskii-Oleg:main Jul 15, 2026
1 check passed
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.

3 participants