Cluster computing JanusGraph群集始终返回不带属性的顶点(ReferenceVertex)

Cluster computing JanusGraph群集始终返回不带属性的顶点(ReferenceVertex),cluster-computing,gremlin,gremlin-server,janusgraph,Cluster Computing,Gremlin,Gremlin Server,Janusgraph,我对janusgraph gremlin服务器和集群客户端有问题。 使用群集(gremlin driver 3.2.3/3.2.5)检索的顶点仅包含id属性、标签和属性始终为空 这是我的客户端配置 val cluster = Cluster.open("/opt/janusgraph-0.1.1-hadoop2/conf/remote-objects.yaml") 远程对象.yaml hosts: [localhost] port: 8182 serializer: { clas

我对janusgraph gremlin服务器和集群客户端有问题。 使用群集(gremlin driver 3.2.3/3.2.5)检索的顶点仅包含id属性、标签和属性始终为空

这是我的客户端配置

val cluster = Cluster.open("/opt/janusgraph-0.1.1-hadoop2/conf/remote-objects.yaml")
远程对象.yaml

hosts: [localhost] 
   port: 8182
   serializer: { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
gremlin服务器配置:

host: localhost
port: 8182
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: {
  graph: conf/gremlin-server/graph.properties}
plugins:
  - janusgraph.imports
scriptEngines: {
  gremlin-groovy: {
    imports: [java.lang.Math],
    staticImports: [java.lang.Math.PI],
    scripts: [scripts/empty-sample.groovy]}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }}
processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }}
  - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }}
metrics: {
  consoleReporter: {enabled: true, interval: 180000},
  csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
  jmxReporter: {enabled: true},
  slf4jReporter: {enabled: true, interval: 180000},
  gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
  graphiteReporter: {enabled: false, interval: 180000}}
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {enabled: false}
使用gremlin控制台的远程查询工作正常(Remote.yaml和Remote objects.yaml)

使用群集和远程遍历的查询不起作用:

val g = EmptyGraph.instance().traversal().withRemote(DriverRemoteConnection.using(cluster, "g"))

g.V().toList.foreach(v => println(v, "id", v.id(), "label", v.label(), v.properties("name").toList, v.getClass))
输出:

(v[8336],id,8336,label,,List(),class org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex)
(v[12288],id,12288,label,,List(),class org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex)
(v[12304],id,12304,label,,List(),class org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex)
(v[12328],id,12328,label,,List(),class org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex)
(v[12360],id,12360,label,,List(),class org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex)

我做错了什么?

当像您尝试的那样处理远程图形时,您将返回包含最少信息的
ReferenceElements
。不幸的是,目前关于这个的文档并不多(我必须解决这个问题),但是你可以参考这个

远程遍历工作得很好,但是您应该在请求中更加明确。例如,如果您想要
标识
标签
和所有
属性
,可以使用:

g.V().valueMap(true).toList()

这将返回属性映射的列表。而不是返回顶点列表。我需要得到包含所有属性的顶点列表