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 2022/08/21 16:04:26 UTC
[incubator-hugegraph] branch master updated: fix: args count of ACTION_CLEARED error (#1941)
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 5172f773a fix: args count of ACTION_CLEARED error (#1941)
5172f773a is described below
commit 5172f773a8e7ec6811423c67bd83105c3e73ae83
Author: Simon Cheung <mi...@apache.org>
AuthorDate: Mon Aug 22 00:04:20 2022 +0800
fix: args count of ACTION_CLEARED error (#1941)
---
.../baidu/hugegraph/backend/cache/CachedGraphTransaction.java | 11 ++++++++---
.../hugegraph/backend/cache/CachedSchemaTransaction.java | 7 ++++++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java
index fa397862f..fed55dc8f 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedGraphTransaction.java
@@ -203,6 +203,11 @@ public final class CachedGraphTransaction extends GraphTransaction {
graphEventHub.notify(Events.CACHE, action, type, ids);
}
+ private void notifyChanges(String action, HugeType type) {
+ EventHub graphEventHub = this.params().graphEventHub();
+ graphEventHub.notify(Events.CACHE, action, type);
+ }
+
private void clearCache(HugeType type, boolean notify) {
if (type == null || type == HugeType.VERTEX) {
this.verticesCache.clear();
@@ -212,7 +217,7 @@ public final class CachedGraphTransaction extends GraphTransaction {
}
if (notify) {
- this.notifyChanges(Cache.ACTION_CLEARED, null, null);
+ this.notifyChanges(Cache.ACTION_CLEARED, null);
}
}
@@ -403,7 +408,7 @@ public final class CachedGraphTransaction extends GraphTransaction {
if (invalidEdgesCache && this.enableCacheEdge()) {
// TODO: Use a more precise strategy to update the edge cache
this.edgesCache.clear();
- this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE, null);
+ this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE);
}
}
}
@@ -417,7 +422,7 @@ public final class CachedGraphTransaction extends GraphTransaction {
if (indexLabel.baseType() == HugeType.EDGE_LABEL) {
// TODO: Use a more precise strategy to update the edge cache
this.edgesCache.clear();
- this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE, null);
+ this.notifyChanges(Cache.ACTION_CLEARED, HugeType.EDGE);
}
}
}
diff --git a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java
index 8c42b2895..331b038df 100644
--- a/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java
+++ b/hugegraph-core/src/main/java/com/baidu/hugegraph/backend/cache/CachedSchemaTransaction.java
@@ -142,6 +142,11 @@ public final class CachedSchemaTransaction extends SchemaTransaction {
graphEventHub.notify(Events.CACHE, action, type, id);
}
+ private final void notifyChanges(String action, HugeType type) {
+ EventHub graphEventHub = this.params().schemaEventHub();
+ graphEventHub.notify(Events.CACHE, action, type);
+ }
+
private final void resetCachedAll(HugeType type) {
// Set the cache all flag of the schema type to false
this.cachedTypes().put(type, false);
@@ -165,7 +170,7 @@ public final class CachedSchemaTransaction extends SchemaTransaction {
this.arrayCaches.clear();
if (notify) {
- this.notifyChanges(Cache.ACTION_CLEARED, null, null);
+ this.notifyChanges(Cache.ACTION_CLEARED, null);
}
}