Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring routing table rediscovery routine #645

Merged
merged 1 commit into from
Dec 2, 2020

Conversation

bigmontz
Copy link
Contributor

@bigmontz bigmontz commented Dec 1, 2020

The goal of this change is prepare the terrain for loading the routing table using the routing message.

Previously, the Rediscovery class was responsible for the parsing the result for the procedure applying the business rules and the RoutingUtil was responsible for calling the correct procedure depending on the protocol version and provide methods to parse the result.

In the new design,

  • Rediscovery is responsible for orchestrating the Session, RoutingTableGetterFactory and RoutingTableGetter to get the Table.
  • RoutingTableGetterFactory is responsible for creating the correct RoutingTableGetter configuration due the protocol version.
  • ProcedureRoutingTableGetter is responsible for getting a valid RoutingTable running the configured procedure
  • SingleDatabaseProcedureRunner is responsible for running the procedure used for single database protocol and return the result
  • MultiDatabaseProcedureRunner is responsible for running the procedure used for multi database protocol and return the result

To extend this model with a new RoutingTable source, you need to create a new getter which will have the same blackbox behaviour of ProcedureRoutingTableGetter and instantiate it properly on the factory.

@bigmontz bigmontz force-pushed the 4.3-routing-message branch from c87aa18 to d0f2c10 Compare December 1, 2020 18:33
The goal of this change is prepare the terrain for loading the routing table using the routing message.

Previously, the `Rediscovery` class was responsible for the parsing the result for the procedure applying the business rules and the `RoutingUtil` was responsible for calling the correct procedure depending on the protocol version and provide methods to parse the result.

In the new design,

* `Rediscovery` is responsible for orchestrating the `Session`, `RoutingTableGetterFactory` and `RoutingTableGetter` to get the `Table`.
* `RoutingTableGetterFactory` is responsible for creating the correct `RoutingTableGetter` configuration due the protocol version.
* `ProcedureRoutingTableGetter` is responsible for getting a valid `RoutingTable` running the configured procedure
* `SingleDatabaseProcedureRunner` is responsible for running the procedure used for single database protocol and return the result
* `MultiDatabaseProcedureRunner` is responsible for running the procedure used for multi database protocol and return the result

To extend this model with a new RoutingTable source, you need to create a new getter which will have the same blackbox behaviour of `ProcedureRoutingTableGetter` and instantiate it properly on the factory.
@bigmontz bigmontz force-pushed the 4.3-routing-message branch from d0f2c10 to 96c0607 Compare December 2, 2020 16:11
@bigmontz bigmontz merged commit 79d7fd4 into neo4j:4.3 Dec 2, 2020
@bigmontz bigmontz deleted the 4.3-routing-message branch December 2, 2020 17:28
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.

1 participant