haohao0103 commented on code in PR #2620:
URL:
https://github.com/apache/incubator-hugegraph/pull/2620#discussion_r1713504301
##########
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/backend/store/AbstractBackendStoreProvider.java:
##########
@@ -67,7 +70,10 @@ protected final void checkOpened() {
@Override
public void listen(EventListener listener) {
- this.storeEventHub.listen(EventHub.ANY_EVENT, listener);
+ if (schemaCacheClearListened.compareAndSet(false, true) ||
+ vertexEdgeCacheClearListened.compareAndSet(false, true)) {
Review Comment:
1、define 2 automic_param boolean A & B;this operation is to ensure that
storeEventListener does not deliver to storeEventHub of storeProvider once in
each thread. I understand that there is no need to re register during the
entire Hugegraph lifecycle, so there is no reset operation; Will this miss
other necessary scenarios?
2、schemaCacheClearListened for schemaCache clear ,
vertexEdgeCacheClearListened for vertex&edge cache;
3、 I have modified it to use the volatile+synchronized,thanks
--
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]