javeme commented on code in PR #2620:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2620#discussion_r1720600241


##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/BackendStoreProvider.java:
##########
@@ -67,6 +67,12 @@ public interface BackendStoreProvider {
 
     void listen(EventListener listener);
 
+    default void listenSchemaCacheClear(EventListener listener) {
+    }
+
+    default void listenDataCacheClear(EventListener listener) {

Review Comment:
   prefer listenGraphCacheAtMostOnce



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/cache/CachedSchemaTransactionV2.java:
##########
@@ -105,7 +105,8 @@ private void listenChanges() {
             }
             return false;
         };
-        
this.graphParams().loadGraphStore().provider().listen(this.storeEventListener);
+        this.graphParams().loadGraphStore().provider()
+            .listenSchemaCacheClear(this.storeEventListener);
 
         // Listen cache event: "cache"(invalid cache item)
         this.cacheEventListener = event -> {

Review Comment:
   @imbajin can you share some context why we added 
CachedSchemaTransactionV2.java? not sure it's used in what scenarios, and can 
we merge V1+V2 into one class?



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/BackendStoreProvider.java:
##########
@@ -67,6 +67,12 @@ public interface BackendStoreProvider {
 
     void listen(EventListener listener);
 
+    default void listenSchemaCacheClear(EventListener listener) {

Review Comment:
   prefer listenSchemaCacheAtMostOnce



##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/cache/CachedGraphTransaction.java:
##########
@@ -133,7 +133,7 @@ private void listenChanges() {
             }
             return false;
         };
-        this.store().provider().listen(this.storeEventListener);
+        this.store().provider().listenDataCacheClear(this.storeEventListener);

Review Comment:
   Sorry I have read the issue, but I still don't quite understand in what 
scenarios.the problem is encountered.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to