public class AutoPartitionLoadBalancingStrategy extends Object implements LoadBalancingStrategy
Constructor and Description |
---|
AutoPartitionLoadBalancingStrategy(com.graphdbapi.driver.v1.Driver driver) |
Modifier and Type | Method and Description |
---|---|
Map<com.graphdbapi.driver.internal.BoltServerAddress,Set<Long>> |
getAddressPartsMap() |
com.graphdbapi.driver.internal.BoltServerAddress |
select(com.graphdbapi.driver.internal.BoltServerAddress[] knownServers,
com.graphdbapi.driver.internal.cluster.StrategyParam params)
在给定的地址数组中选择最合适的地址。
|
void |
setGraphIndex(Integer graphIndex) |
public AutoPartitionLoadBalancingStrategy(com.graphdbapi.driver.v1.Driver driver)
driver
- 使用cluster://创建的驱动对象实例NoSuchFieldException
- 可能driver中获取分片信息的时候存在空值对象public Map<com.graphdbapi.driver.internal.BoltServerAddress,Set<Long>> getAddressPartsMap()
public com.graphdbapi.driver.internal.BoltServerAddress select(com.graphdbapi.driver.internal.BoltServerAddress[] knownServers, com.graphdbapi.driver.internal.cluster.StrategyParam params)
LoadBalancingStrategy
select
in interface LoadBalancingStrategy
knownServers
- 已知路由表中的地址数组params
- 自定义策略所需要的属性,例如执行语句中的方法名、图INDEX、执行的参数public void setGraphIndex(Integer graphIndex)
Copyright © 2024. All rights reserved.