public class GraphDb extends Object
| Constructor and Description |
|---|
GraphDb() |
| Modifier and Type | Method and Description |
|---|---|
static com.graphdbapi.driver.v1.Driver |
connect(String uri,
String username,
String password)
连接到数据库
|
static com.graphdbapi.driver.v1.Driver |
connect(String uri,
String username,
String password,
Config config)
获取driver
|
static com.graphdbapi.driver.v1.Driver |
connectCluster(Set<String> uris,
String username,
String password)
多IP连接路由driver
|
static com.graphdbapi.driver.v1.Driver |
connectCluster(Set<String> uris,
String username,
String password,
Config config)
多IP连接路由driver
|
static com.graphdbapi.driver.v1.Driver |
connectCluster(String uris,
String username,
String password)
多IP连接路由driver
|
static com.graphdbapi.driver.v1.Driver |
connectCluster(String uris,
String username,
String password,
Config config)
多IP连接路由driver
|
static Graph |
driver(com.graphdbapi.driver.v1.Driver driver,
String graphName)
连接到图服务
|
static Graph |
driver(com.graphdbapi.driver.v1.Driver driver,
String graphName,
LoadBalancingStrategy graphStrategy)
通过自定义策略实现不同的负载均衡分发的图(创建driver时应该使用的是cluster协议)
|
static Graph |
driver(String uri,
String graphName,
String token)
Deprecated.
|
static Graph |
driver(String uri,
String graphName,
String username,
String password)
Deprecated.
|
static com.graphdbapi.driver.v1.Driver |
driver(URI uri,
com.graphdbapi.driver.v1.AuthToken token,
Config config) |
static Graph |
driver(URI uri,
String graphName,
String username,
String password)
Deprecated.
|
static Graph |
driverByIndex(com.graphdbapi.driver.v1.Driver driver,
int graphIndex)
通过图index获取图服务。通过服务端进行验证。
|
static Graph |
driverByIndex(com.graphdbapi.driver.v1.Driver driver,
int graphIndex,
LoadBalancingStrategy graphStrategy)
通过图index、自定义策略获取图服务(创建driver时应该使用的是cluster协议)。通过服务端进行验证。
|
static Graph |
driverByName(com.graphdbapi.driver.v1.Driver driver,
String graphName)
通过图名字获取图服务。通过服务端进行验证。
|
static Graph |
driverByName(com.graphdbapi.driver.v1.Driver driver,
String graphName,
LoadBalancingStrategy graphStrategy)
通过图名字、自定义策略获取图服务(创建driver时应该使用的是cluster协议)。通过服务端进行验证。
|
static com.graphdbapi.driver.v1.Driver |
driverByRoutingTable(Set<String> uris,
String username,
String password)
根据指定路由表获取路由driver(不允许使用AutoPartitionLoadBalancingStrategy策略)
|
static String |
getDriverVersion()
获取driver版本
|
static GraphGroup |
getGraphGroup(com.graphdbapi.driver.v1.Driver driver,
String... graphNames)
连接到图组
|
static Collection<String> |
graphs(com.graphdbapi.driver.v1.Driver driver)
获取图名字
|
static List<MetricInfo> |
metrics(com.graphdbapi.driver.v1.Driver driver)
获取节点的metric信息
|
static Graph |
newGraph(com.graphdbapi.driver.v1.Driver driver,
String graphName)
新建一个图
|
static Graph |
newGraph(com.graphdbapi.driver.v1.Driver driver,
String graphName,
String groupName)
Deprecated.
|
public static com.graphdbapi.driver.v1.Driver connect(String uri, String username, String password)
uri - 链接地址username - 用户名password - 密码Driverpublic static com.graphdbapi.driver.v1.Driver connect(String uri, String username, String password, Config config)
uri - 链接地址username - 用户名password - 密码config - 配置信息Driverpublic static com.graphdbapi.driver.v1.Driver connectCluster(Set<String> uris, String username, String password) throws UnknownHostException
uris - 连接的ip地址集合(例:["192.168.10.125:7687", "192.168.10.126:7687"])username - 用户名password - 密码DriverUnknownHostExceptionpublic static com.graphdbapi.driver.v1.Driver connectCluster(Set<String> uris, String username, String password, Config config) throws UnknownHostException
uris - 连接的ip地址集合(例:["192.168.10.125:7687", "192.168.10.126:7687"])username - 用户名password - 密码config - Config 配置DriverUnknownHostExceptionpublic static com.graphdbapi.driver.v1.Driver connectCluster(String uris, String username, String password) throws UnknownHostException
uris - 多IP的uri字符串(例:"cluster://192.168.10.125:7687,192.168.10.126:7687")username - 用户名password - 密码DriverUnknownHostExceptionpublic static com.graphdbapi.driver.v1.Driver connectCluster(String uris, String username, String password, Config config) throws UnknownHostException
uris - 多IP的uri字符串(例:"cluster://192.168.10.125:7687,192.168.10.126:7687")username - 用户名password - 密码config - Config 配置DriverUnknownHostExceptionpublic static Graph driver(com.graphdbapi.driver.v1.Driver driver, String graphName)
driver - 链接graphName - 图名称Graphpublic static Graph driver(com.graphdbapi.driver.v1.Driver driver, String graphName, LoadBalancingStrategy graphStrategy) throws NoSuchFieldException
driver - 链接(使用的时候保证为routingDriver)graphName - 图名称graphStrategy - 自定义策略GraphNoSuchFieldException - 使用协议不正确时抛出@Deprecated public static Graph driver(String uri, String graphName, String token)
uri - 链接地址graphName - 图名称token - 用户登录获得的tokenGraph@Deprecated public static Graph driver(String uri, String graphName, String username, String password)
uri - 链接地址graphName - 图名称username - 用户名password - 密码Graphpublic static com.graphdbapi.driver.v1.Driver driver(URI uri, com.graphdbapi.driver.v1.AuthToken token, Config config)
@Deprecated public static Graph driver(URI uri, String graphName, String username, String password)
uri - 链接地址graphName - 图名称username - 用户名password - 密码Graphpublic static Graph driverByIndex(com.graphdbapi.driver.v1.Driver driver, int graphIndex)
driver - 链接graphIndex - 图indexGraphpublic static Graph driverByIndex(com.graphdbapi.driver.v1.Driver driver, int graphIndex, LoadBalancingStrategy graphStrategy)
driver - 链接(使用的时候保证为routingDriver)graphIndex - 图indexgraphStrategy - 图级别策略Graphpublic static Graph driverByName(com.graphdbapi.driver.v1.Driver driver, String graphName)
driver - 链接graphName - 图名字Graphpublic static Graph driverByName(com.graphdbapi.driver.v1.Driver driver, String graphName, LoadBalancingStrategy graphStrategy)
driver - 链接(使用的时候保证为routingDriver)graphName - 图名字graphStrategy - 图级别策略Graphpublic static com.graphdbapi.driver.v1.Driver driverByRoutingTable(Set<String> uris, String username, String password)
uris - 链接地址集合(格式:127.0.0.1:7687)username - 用户名password - 密码Graphpublic static String getDriverVersion()
public static GraphGroup getGraphGroup(com.graphdbapi.driver.v1.Driver driver, String... graphNames)
driver - 连接graphNames - 图组中图名字public static Collection<String> graphs(com.graphdbapi.driver.v1.Driver driver)
driver - 连接public static List<MetricInfo> metrics(com.graphdbapi.driver.v1.Driver driver)
driver - 连接public static Graph newGraph(com.graphdbapi.driver.v1.Driver driver, String graphName)
driver - 链接graphName - 图名称Graph@Deprecated public static Graph newGraph(com.graphdbapi.driver.v1.Driver driver, String graphName, String groupName)
driver - 链接graphName - 图名称groupName - 组名称GraphCopyright © 2024. All rights reserved.