Module org.neo4j.driver
Class LeastConnectedLoadBalancingStrategy
java.lang.Object
org.neo4j.driver.internal.bolt.routedimpl.cluster.loadbalancing.LeastConnectedLoadBalancingStrategy
- All Implemented Interfaces:
LoadBalancingStrategy
-
Constructor Summary
ConstructorsConstructorDescriptionLeastConnectedLoadBalancingStrategy(Function<BoltServerAddress, Integer> inUseFunction, LoggingProvider logging) -
Method Summary
Modifier and TypeMethodDescriptionselectReader(List<BoltServerAddress> knownReaders) Select most appropriate read address from the given array of addresses.selectWriter(List<BoltServerAddress> knownWriters) Select most appropriate write address from the given array of addresses.
-
Constructor Details
-
LeastConnectedLoadBalancingStrategy
public LeastConnectedLoadBalancingStrategy(Function<BoltServerAddress, Integer> inUseFunction, LoggingProvider logging)
-
-
Method Details
-
selectReader
Description copied from interface:LoadBalancingStrategySelect most appropriate read address from the given array of addresses.- Specified by:
selectReaderin interfaceLoadBalancingStrategy- Parameters:
knownReaders- array of all known readers.- Returns:
- most appropriate reader or
nullif it can't be selected.
-
selectWriter
Description copied from interface:LoadBalancingStrategySelect most appropriate write address from the given array of addresses.- Specified by:
selectWriterin interfaceLoadBalancingStrategy- Parameters:
knownWriters- array of all known writers.- Returns:
- most appropriate writer or
nullif it can't be selected.
-