Skip to content

Commit

Permalink
fix: args count of ACTION_CLEARED error (#1941)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon824 authored Aug 21, 2022
1 parent 7274a5f commit 5172f77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ private void notifyChanges(String action, HugeType type, Id[] ids) {
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();
Expand All @@ -212,7 +217,7 @@ private void clearCache(HugeType type, boolean notify) {
}

if (notify) {
this.notifyChanges(Cache.ACTION_CLEARED, null, null);
this.notifyChanges(Cache.ACTION_CLEARED, null);
}
}

Expand Down Expand Up @@ -403,7 +408,7 @@ protected final void commitMutation2Backend(BackendMutation... mutations) {
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);
}
}
}
Expand All @@ -417,7 +422,7 @@ public final void removeIndex(IndexLabel indexLabel) {
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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ private final void notifyChanges(String action, HugeType type, Id id) {
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);
Expand All @@ -165,7 +170,7 @@ private final void clearCache(boolean notify) {
this.arrayCaches.clear();

if (notify) {
this.notifyChanges(Cache.ACTION_CLEARED, null, null);
this.notifyChanges(Cache.ACTION_CLEARED, null);
}
}

Expand Down

0 comments on commit 5172f77

Please sign in to comment.