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.
Passing system bookmarks to
getRT
call for bolt v4 connections. The main problem to solve is to find the routing table for a newly created database. When a new database is created, the system database is updated and then the new database is reconciled into existence asynchronously. The system database bookmarks allow us to make a causal link from the created database to the updated routing tables that included it.System Bookmarks are only used if a routing table update is needed when creating a session. If there is already a valid routing table, then the driver has no problem to route to the specified database in a cluster.
Bookmark is changed from a
String
toBookmark
object.Here is the story how this change happened.
Session#lastBookmark
need to be able to return one or multiple bookmark strings. Normally, if we get a bookmark from server, the bookmark is a single string. However if the bookmark is provided by a user, then the bookmark can be a list of strings. AsSession#lastBookmark
can be called any time, so the bookmark can be one or multiple bookmark strings. If we simply return aList
of strings rather than aBookmark
object, thenSessionConfig#withBookmarks
has to accept aList
ofList
of string. This API dose not look good. Thus we come to the conclusion to make a bookmark object.In the driver implementation to support system bookmark, a
ConnectionContext
is added to carry this system bookmarks down to rediscovery service. It is kind like aSessionConfig
but it carries current connection access mode rather than default access mode.