Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit dcea137

Browse files
committed
Adding a TODO item around invaliding caching, as Zookeeper is capable of doing that across clients, and perhaps other systems have or will have that as well.
1 parent 68b55fa commit dcea137

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

extensions/entitystore-zookeeper/src/main/java/org/apache/polygene/entitystore/zookeeper/ZookeeperEntityStoreMixin.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public void activateService()
9494

9595
int sessionTimeout = config.sessionTimeout().get();
9696

97-
zkClient = new ZooKeeper( hostPort, sessionTimeout, watcher == null ? new DummyWatcher() : watcher );
97+
zkClient = new ZooKeeper( hostPort, sessionTimeout, watcher == null ? new EntityStoreWatcher() : watcher );
9898
createStorageNodeIfNotExists( config );
9999
}
100100

@@ -324,9 +324,16 @@ public Reader next()
324324
}
325325
}
326326

327-
private class DummyWatcher
327+
private class EntityStoreWatcher
328328
implements Watcher
329329
{
330+
// TODO: Invalidate cache?
331+
// I (niclas) think that the only events that arrive here are create, delete, data changed and children changed
332+
// So, the question is; Should we try to invalidate the cache (if present) for these changes? If so; How is that done?
333+
//
334+
// Additionally, that might raise the question of having cache invalidation interface in the EntityStore SPI, and
335+
// by extension into the MapEntityStore SPI.
336+
330337
@Override
331338
public void process( WatchedEvent event )
332339
{

0 commit comments

Comments
 (0)