GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Performance: speedup remote gremlin traversal · Issue #1373 · ArcadeData/arcadedb Closed Description(From a thread on the official Discord Channel) ArcadeDB provides the useful While this works, it's sub-optimal because every step is executed on the server side. The best solution should be wrapping the traversal execution as a Gremlin Client call and executing it on the remote GremlinServer. This means the GremlinServer plugin must be activated on ArcadeDB server to use remote traversal. The only issue with this is the transaction isolation: an open transaction on a remote database, and therefore remote ArcadeGraph, will be in a separate scope than the traversal. This means if a client is executing an insert of vertices, the transaction must be committed before executing the remote traversal, or the traversal will not see the newly added vertices. Example: @Test public void executeTraversalSeparateTransactions() { try (ArcadeGraphFactory pool = ArcadeGraphFactory.withRemote("127.0.0.1", 2480, getDatabaseName(), "root", BaseGraphServerTest.DEFAULT_PASSWORD_FOR_TESTS)) { try (final ArcadeGraph graph = pool.get()) { for (int i = 0; i < 1_000; i++) graph.addVertex(org.apache.tinkerpop.gremlin.structure.T.label, "inputstructure", "json", "{\"name\": \"Elon\"}"); // THIS IS IN THE SAME SCOPE, SO IT CAN SEE THE PENDING VERTICES ADDED EARLIER try (final ResultSet list = graph.gremlin("g.V().hasLabel(\"inputstructure\").count()").execute()) { Assertions.assertEquals(1_000, (Integer) list.nextIfAvailable().getProperty("result")); } graph.tx().commit(); // <-- WITHOUT THIS COMMIT THE 2ND TRAVERSAL WOULD NOT SEE THE ADDED VERTICES Assertions.assertEquals(1_000, graph.traversal().V().hasLabel("inputstructure").count().next()); Assertions.assertEquals(1_000, graph.traversal().V().hasLabel("inputstructure").count().toList().get(0)); } } } Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |