java.lang.Object
org.neo4j.driver.internal.cluster.RoutingTableRegistryImpl
- All Implemented Interfaces:
RoutingTableRegistry
-
Constructor Summary
ConstructorDescriptionRoutingTableRegistryImpl
(ConnectionPool connectionPool, Rediscovery rediscovery, Clock clock, Logging logging, long routingTablePurgeDelayMs) -
Method Summary
Modifier and TypeMethodDescriptionSet<org.neo4j.driver.internal.BoltServerAddress>
boolean
contains
(org.neo4j.driver.internal.DatabaseName databaseName) ensureRoutingTable
(ConnectionContext context) Ensures the routing table for the database with given access mode.getRoutingTableHandler
(org.neo4j.driver.internal.DatabaseName databaseName) Returns routing table handler for the given database name if it exists in the registry.void
remove
(org.neo4j.driver.internal.DatabaseName databaseName) Removes a routing table of the given database from registry.void
Removes all routing tables that has been not used for a long time.
-
Constructor Details
-
RoutingTableRegistryImpl
public RoutingTableRegistryImpl(ConnectionPool connectionPool, Rediscovery rediscovery, Clock clock, Logging logging, long routingTablePurgeDelayMs)
-
-
Method Details
-
ensureRoutingTable
Description copied from interface:RoutingTableRegistry
Ensures the routing table for the database with given access mode. For server version lower than 4.0, the database name will be ignored while refreshing routing table.- Specified by:
ensureRoutingTable
in interfaceRoutingTableRegistry
- Returns:
- The future of a new routing table handler.
-
allServers
- Specified by:
allServers
in interfaceRoutingTableRegistry
- Returns:
- all servers in the registry
-
remove
public void remove(org.neo4j.driver.internal.DatabaseName databaseName) Description copied from interface:RoutingTableRegistry
Removes a routing table of the given database from registry.- Specified by:
remove
in interfaceRoutingTableRegistry
-
removeAged
public void removeAged()Description copied from interface:RoutingTableRegistry
Removes all routing tables that has been not used for a long time.- Specified by:
removeAged
in interfaceRoutingTableRegistry
-
getRoutingTableHandler
public Optional<RoutingTableHandler> getRoutingTableHandler(org.neo4j.driver.internal.DatabaseName databaseName) Description copied from interface:RoutingTableRegistry
Returns routing table handler for the given database name if it exists in the registry.- Specified by:
getRoutingTableHandler
in interfaceRoutingTableRegistry
- Parameters:
databaseName
- the database name- Returns:
- the routing table handler for the requested database name
-
contains
public boolean contains(org.neo4j.driver.internal.DatabaseName databaseName)
-