You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hugegraph.apache.org by ji...@apache.org on 2023/03/14 09:59:21 UTC
[incubator-hugegraph] branch master updated: fix query dirty edges of a vertex with cache (#2166)
This is an automated email from the ASF dual-hosted git repository.
jin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-hugegraph.git
The following commit(s) were added to refs/heads/master by this push:
new 901da45e5 fix query dirty edges of a vertex with cache (#2166)
901da45e5 is described below
commit 901da45e591ce52bdd0b520784085c2fc9299f68
Author: Jermy Li <je...@apache.org>
AuthorDate: Tue Mar 14 17:59:11 2023 +0800
fix query dirty edges of a vertex with cache (#2166)
fix #2163
Change-Id: I58b26f8a791885800e42821a3d4b2724f4e647a0
---
.../org/apache/hugegraph/structure/HugeVertex.java | 23 ++++++++--------------
1 file changed, 8 insertions(+), 15 deletions(-)
diff --git a/hugegraph-core/src/main/java/org/apache/hugegraph/structure/HugeVertex.java b/hugegraph-core/src/main/java/org/apache/hugegraph/structure/HugeVertex.java
index a61ab5a2f..c270312b0 100644
--- a/hugegraph-core/src/main/java/org/apache/hugegraph/structure/HugeVertex.java
+++ b/hugegraph-core/src/main/java/org/apache/hugegraph/structure/HugeVertex.java
@@ -36,12 +36,20 @@ import org.apache.hugegraph.backend.id.SplicingIdGenerator;
import org.apache.hugegraph.backend.query.ConditionQuery;
import org.apache.hugegraph.backend.query.Query;
import org.apache.hugegraph.backend.query.QueryResults;
+import org.apache.hugegraph.backend.serializer.BytesBuffer;
import org.apache.hugegraph.backend.tx.GraphTransaction;
import org.apache.hugegraph.config.CoreOptions;
+import org.apache.hugegraph.perf.PerfUtil.Watched;
import org.apache.hugegraph.schema.EdgeLabel;
import org.apache.hugegraph.schema.PropertyKey;
import org.apache.hugegraph.schema.VertexLabel;
import org.apache.hugegraph.type.HugeType;
+import org.apache.hugegraph.type.define.Cardinality;
+import org.apache.hugegraph.type.define.CollectionType;
+import org.apache.hugegraph.type.define.Directions;
+import org.apache.hugegraph.type.define.HugeKeys;
+import org.apache.hugegraph.type.define.IdStrategy;
+import org.apache.hugegraph.util.E;
import org.apache.hugegraph.util.collection.CollectionFactory;
import org.apache.logging.log4j.util.Strings;
import org.apache.tinkerpop.gremlin.structure.Direction;
@@ -51,16 +59,6 @@ import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-
-import org.apache.hugegraph.backend.serializer.BytesBuffer;
-import org.apache.hugegraph.perf.PerfUtil.Watched;
-import org.apache.hugegraph.type.define.Cardinality;
-import org.apache.hugegraph.type.define.CollectionType;
-import org.apache.hugegraph.type.define.Directions;
-import org.apache.hugegraph.type.define.HugeKeys;
-import org.apache.hugegraph.type.define.IdStrategy;
-import org.apache.hugegraph.util.E;
-import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyProperty;
import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyVertexProperty;
import com.google.common.collect.ImmutableList;
@@ -383,11 +381,6 @@ public class HugeVertex extends HugeElement implements Vertex, Cloneable {
@Override
public Iterator<Edge> edges(Direction tinkerpopDir, String... edgeLabels) {
Directions direction = Directions.convert(tinkerpopDir);
- // NOTE: get edges from memory if load all edges when loading vertex.
- if (this.existsEdges()) {
- return this.getEdges(direction, edgeLabels);
- }
-
Id[] edgeLabelIds = this.graph().mapElName2Id(edgeLabels);
Query query = GraphTransaction.constructEdgesQuery(this.id(), direction,
edgeLabelIds);