Aiman
Aiman
Explore posts from servers
JJanusGraph
Created by Aiman on 6/24/2024 in #questions
How do we generate transaction logs ?
This is how I created Client
def loadClient(graphId: String): Client = {
val typeSerializerRegistry = TypeSerializerRegistry.build.addRegistry(JanusGraphIoRegistry.instance).create
val cluster = Cluster.build()
.addContactPoint(contactUrl)
.port(port.asInstanceOf[Int])
.serializer(new GraphBinaryMessageSerializerV1(typeSerializerRegistry))
.create()

cluster.connect()
}
def loadClient(graphId: String): Client = {
val typeSerializerRegistry = TypeSerializerRegistry.build.addRegistry(JanusGraphIoRegistry.instance).create
val cluster = Cluster.build()
.addContactPoint(contactUrl)
.port(port.asInstanceOf[Int])
.serializer(new GraphBinaryMessageSerializerV1(typeSerializerRegistry))
.create()

cluster.connect()
}
This how the query is executed
client.submit(query, statementParameters).all().get()
client.submit(query, statementParameters).all().get()
16 replies
ATApache TinkerPop
Created by Aiman on 6/19/2024 in #questions
Expecting java.lang.ArrayList/java.lang.List instead of java.lang.String. Where am I going wrong?
gremlin> :remote connect tinkerpop.server conf/remote.yaml session
Jun 19, 2024 6:04:36 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for org.apache.tinkerpop.gremlin.driver.Settings.serializers
18:04:37 INFO org.apache.tinkerpop.gremlin.driver.Connection.<init> - Created new connection for ws://localhost:8182/gremlin
18:04:37 INFO org.apache.tinkerpop.gremlin.driver.ConnectionPool.<init> - Opening connection pool on Host{address=localhost/127.0.0.1:8182, hostUri=ws://localhost:8182/gremlin} with core size of 1
==>Configured localhost/127.0.0.1:8182-[f353f6b1-f0b6-4b21-b928-1fd772211169]
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182]-[f353f6b1-f0b6-4b21-b928-1fd772211169] - type ':remote console' to return to local mode
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard]
gremlin>
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@1f373aaf
gremlin> maker = mgmt.makePropertyKey('language')
==>org.janusgraph.graphdb.types.StandardPropertyKeyMaker@40921f9d
gremlin> maker.dataType(String.class)
==>org.janusgraph.graphdb.types.StandardPropertyKeyMaker@40921f9d
gremlin> maker.cardinality(LIST)
==>org.janusgraph.graphdb.types.StandardPropertyKeyMaker@40921f9d
gremlin> maker.make()
==>language
gremlin> mgmt.commit()
==>null
gremlin> g.addV('domain').property('language', ['English', 'Hindi']).property('name', 'aim').next()
==>v[4104]
gremlin> g.V(4104).properties('language').value().next().getClass()
==>class java.lang.String
gremlin> :remote connect tinkerpop.server conf/remote.yaml session
Jun 19, 2024 6:04:36 PM org.yaml.snakeyaml.internal.Logger warn
WARNING: Failed to find field for org.apache.tinkerpop.gremlin.driver.Settings.serializers
18:04:37 INFO org.apache.tinkerpop.gremlin.driver.Connection.<init> - Created new connection for ws://localhost:8182/gremlin
18:04:37 INFO org.apache.tinkerpop.gremlin.driver.ConnectionPool.<init> - Opening connection pool on Host{address=localhost/127.0.0.1:8182, hostUri=ws://localhost:8182/gremlin} with core size of 1
==>Configured localhost/127.0.0.1:8182-[f353f6b1-f0b6-4b21-b928-1fd772211169]
gremlin> :remote console
==>All scripts will now be sent to Gremlin Server - [localhost/127.0.0.1:8182]-[f353f6b1-f0b6-4b21-b928-1fd772211169] - type ':remote console' to return to local mode
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[inmemory:[127.0.0.1]], standard]
gremlin>
gremlin> mgmt = graph.openManagement()
==>org.janusgraph.graphdb.database.management.ManagementSystem@1f373aaf
gremlin> maker = mgmt.makePropertyKey('language')
==>org.janusgraph.graphdb.types.StandardPropertyKeyMaker@40921f9d
gremlin> maker.dataType(String.class)
==>org.janusgraph.graphdb.types.StandardPropertyKeyMaker@40921f9d
gremlin> maker.cardinality(LIST)
==>org.janusgraph.graphdb.types.StandardPropertyKeyMaker@40921f9d
gremlin> maker.make()
==>language
gremlin> mgmt.commit()
==>null
gremlin> g.addV('domain').property('language', ['English', 'Hindi']).property('name', 'aim').next()
==>v[4104]
gremlin> g.V(4104).properties('language').value().next().getClass()
==>class java.lang.String
32 replies