|
40 | 40 | import org.apache.tinkerpop.gremlin.structure.VertexProperty; |
41 | 41 | import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory; |
42 | 42 | import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph; |
| 43 | +import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; |
43 | 44 | import org.apache.tinkerpop.gremlin.util.message.RequestMessage; |
44 | 45 | import org.apache.tinkerpop.gremlin.util.message.ResponseMessage; |
45 | 46 |
|
@@ -115,12 +116,22 @@ private Model() { |
115 | 116 | addCoreEntry(new java.sql.Timestamp(1481750076295L), "Timestamp", ""); |
116 | 117 | addCoreEntry(UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786"), "UUID"); |
117 | 118 |
|
118 | | - addGraphStructureEntry(graph.edges().next(), "Edge", ""); |
119 | | - addGraphStructureEntry(g.V().out().out().path().next(), "Path", ""); |
120 | | - addGraphStructureEntry(graph.edges().next().properties().next(), "Property", ""); |
| 119 | + addGraphStructureEntry(IteratorUtils.list(graph.edges()).stream() |
| 120 | + .sorted((e1, e2) -> Integer.compare((Integer)e1.id(), (Integer)e2.id())) |
| 121 | + .iterator().next(), "Edge", ""); |
| 122 | + addGraphStructureEntry(g.V().order().by(T.id).out().out().path().next(), "Path", ""); |
| 123 | + addGraphStructureEntry(IteratorUtils.list(graph.edges()).stream() |
| 124 | + .sorted((e1, e2) -> Integer.compare((Integer)e1.id(), (Integer)e2.id())) |
| 125 | + .iterator().next().properties().next(), "Property", ""); |
121 | 126 | addGraphStructureEntry(graph, "TinkerGraph", "`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`."); |
122 | | - addGraphStructureEntry(graph.vertices().next(), "Vertex", ""); |
123 | | - addGraphStructureEntry(graph.vertices().next().properties().next(), "VertexProperty", ""); |
| 127 | + addGraphStructureEntry(IteratorUtils.list(graph.vertices()).stream() |
| 128 | + .sorted((v1, v2) -> Integer.compare((Integer)v1.id(), (Integer)v2.id())) |
| 129 | + .iterator().next(), "Vertex", ""); |
| 130 | + addGraphStructureEntry(IteratorUtils.list(IteratorUtils.list(graph.vertices()).stream() |
| 131 | + .sorted((v1, v2) -> Integer.compare((Integer)v1.id(), (Integer)v2.id())) |
| 132 | + .iterator().next().properties()).stream() |
| 133 | + .sorted((p1, p2) -> Long.compare((Long)p1.id(), (Long)p2.id())) |
| 134 | + .iterator().next(), "VertexProperty", ""); |
124 | 135 |
|
125 | 136 | addGraphProcessEntry(SackFunctions.Barrier.normSack, "Barrier", ""); |
126 | 137 | addGraphProcessEntry(new Bytecode.Binding("x", 1), "Binding", "A \"Binding\" refers to a `Bytecode.Binding`."); |
@@ -153,7 +164,7 @@ private Model() { |
153 | 164 | // TextP was only added at 3.4.0 and is not supported with untyped GraphSON of any sort |
154 | 165 | addGraphProcessEntry(TextP.containing("ark"), "TextP", ""); |
155 | 166 | addGraphProcessEntry(createStaticTraversalMetrics(), "TraversalMetrics", ""); |
156 | | - addGraphProcessEntry(g.V().hasLabel("person").asAdmin().nextTraverser(), "Traverser", ""); |
| 167 | + addGraphProcessEntry(g.V().hasLabel("person").order().by(T.id).asAdmin().nextTraverser(), "Traverser", ""); |
157 | 168 |
|
158 | 169 | final Map<String,Object> requestBindings = new HashMap<>(); |
159 | 170 | requestBindings.put("x", 1); |
|
0 commit comments