Use InfoPatterns enum for ReplicaTopologyProvider pattern management #3264
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the
ReplicaTopologyProvider
class to improve pattern management by introducing anInfoPatterns
enum. The enum groups related regular expression patterns previously defined as individualstatic final Pattern
constants, enhancing code organization, type safety, and readability. The change is backward-compatible with no functional impact.Key changes:
static Pattern
constants withInfoPatterns
enum to group related patterns.getNested
method to acceptInfoPatterns
for improved type safety and readability.InfoPatterns
enum and related methods to clarify usage.getCurrentNodeDescription
andgetNested
for better debugging.Checklist
mvn formatter:format
target. No formatting-related changes were submitted.Additional Notes
ReplicaTopologyProvider
pass without modification, as the change is purely structural. Additional unit tests were added to verify thatInfoPatterns
correctly compiles and matches patterns for variousINFO REPLICATION
outputs.InfoPatterns
enum and related methods to improve maintainability and guide future contributors.ReplicaTopologyProvider
and does not affect the public API or user-facing behavior.Related Issue
Closes #3263