Skip to content

Commit

Permalink
Refactor the internal function parse_cluster_nodes (#119)
Browse files Browse the repository at this point in the history
* Refactor the internal function `parse_cluster_nodes`.
Parse the `CLUSTER NODES` reply by a simpler string search.
Parse each line once using a new function `parse_cluster_nodes_line`,
which returns a `valkeyClusterNode`.
Replicas are only parsed when configured, like legacy.

* Refactor the replica handling in CLUSTER NODES parsing.
Store parsed replicas in a separate dict during parsing, and move them
to their primary when all lines are parsed.

Signed-off-by: Björn Svensson <[email protected]>
Co-authored-by: Viktor Söderqvist <[email protected]>
  • Loading branch information
bjosv and zuiderkwast authored Oct 28, 2024
1 parent 500d39d commit 6f2ba3a
Show file tree
Hide file tree
Showing 3 changed files with 282 additions and 339 deletions.
Loading

0 comments on commit 6f2ba3a

Please sign in to comment.