gremlin - Gremlin Java 3.4 withRemote 已弃用
问题描述
所以在 gremlin java 3.4 之前,我使用以下代码连接到远程图:
Cluster.Builder builder = Cluster.build();
builder.addContactPoint(GREMLIN_SERVER);
builder.port(GREMLIN_PORT);
builder.serializer(new GryoMessageSerializerV1d0());
cluster = builder.create();
g = EmptyGraph.instance().traversal().withRemote(DriverRemoteConnection.using(cluster, GRAPH_NAME));
return g;
我已将 JanusGraph 更新到版本 0.4.0 并尝试使用 gremlin java 3.4.3,我看到每个 withRemote 方法现在都已弃用。
gremlin 服务器配置为将 JanusGraphManager 与 ConfigurationManagementGraph 一起使用。并在启动时运行以下脚本:
def globals = [:]
def getGraph() {
def graphNames = ConfiguredGraphFactory.getGraphNames();
def graphMaps = [:];
for (graphName in graphNames) {
def g = ConfiguredGraphFactory.open(graphName);
graphMaps.put(graphName, g.traversal())
}
return graphMaps;
}
globals << getGraph()
我似乎找不到从 java 获取遍历源的新正确方法。
解决方案
推荐阅读
- kotlin - 如何在 InteliJ IDEA 中设置 Kotlin 自定义编译器?
- javascript - 使用一些匹配模式进行 url 验证的正则表达式
- mysql - SQL如何像一张连续的表一样查询多张表?
- lua - 打印语句不在 ipairs 循环中执行
- selenium - 机器人框架如何支持登录任意站点
- mfc - 使用CMFCPropertyGridCtrl,如何避免鼠标移动到内容过长的编辑框时出现提示?
- node.js - Docker Nodejs Redis 连接到 127.0.0.1:6379 失败
- deployment - 无法在数字海洋水滴中启动服务器
- python - 从仅在 Python 上保存为图像的 PDF 文件中提取文本
- python - 如何将 .sql 文件传递给 spark.sql 并且 .sql 文件在谷歌存储中