Skip to content

FEAT: Add hasher parsing support - #370

Closed
AntoxaBarin wants to merge 9 commits into
mainfrom
hasher_parsing
Closed

FEAT: Add hasher parsing support#370
AntoxaBarin wants to merge 9 commits into
mainfrom
hasher_parsing

Conversation

@AntoxaBarin

@AntoxaBarin AntoxaBarin commented Jul 20, 2025

Copy link
Copy Markdown
Contributor

closes #373

@AntoxaBarin
AntoxaBarin marked this pull request as draft July 20, 2025 20:25
@AntoxaBarin
AntoxaBarin marked this pull request as ready for review July 20, 2025 20:36
Comment thread source/parser/identifiable_parser/parse_host.cpp Outdated
Comment thread source/parser/identifiable_parser/parse_switch.cpp Outdated
Comment thread source/parser/parse_utils.cpp Outdated
Comment on lines +73 to +74
LOG_WARN(fmt::format("Unknown hasher type: {}", hasher_value));
return std::make_unique<sim::BaseHasher>();

@PaulRalnikov PaulRalnikov Jul 22, 2025

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.

I think its better to throw error here:

Suggested change
LOG_WARN(fmt::format("Unknown hasher type: {}", hasher_value));
return std::make_unique<sim::BaseHasher>();
throw std::runtime_error(fmt::format("Unsupported hasher type: {}", hasher_value));

@ArtyomPeshkov ArtyomPeshkov Jul 22, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we really want to force user to specify hasher? I think it would be more convenient to just set some default value if hasher is not specified and write some warining log, as suggested above

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.

We have 'parse_with_default', so yes

Comment thread source/parser/parse_utils.cpp Outdated
If there is no 'hasher' field in config, use BasicHasher
Comment thread source/parser/parse_utils.cpp Outdated
Comment thread source/parser/parser.cpp
std::shared_ptr<HostType> ptr =
IdentifieableParser<HostType>::parse_and_registrate(
key_node, val_node);
key_node, val_node, std::move(parsed_hasher));

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.

You may move field parsed_hasher more than one time. Please, change the architecture

@PaulRalnikov

Copy link
Copy Markdown
Collaborator

Closed until parsing refactoring

@PaulRalnikov
PaulRalnikov deleted the hasher_parsing branch August 5, 2025 15:37
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.

FEAT: hasher parsing support

4 participants