On Wed, Mar 14, 2012 at 9:22 AM, Carroll, Jim <[email protected]> wrote: >>Not sure I follow. However the typical use case, let's say for a data >>watch, is to 1) getData("/foo", true) 2) wait for the watch to fire >>3) then do another getData("/foo", true). If multiple changes >>occurred btw 2 and 3 you will see the results when 3 returns. If there >>are subsequent changes after 3 you'll receive another notification, >>etc... > > This means there's not really any way to avoid the "flood" of client > get-state requests (getData/getChildren/exists) that will happen when a > change triggers a watcher. In your example a getData call will happen in > every client at step (2) whenever a change happens. There's no way to avoid > it. I'm Ok with that, it's just that the documentation (at some place I cant > seem to find now) says to try to avoid this.
See the recipes page for some examples of how to avoid herd effects. Sometimes it's possible, but not always: http://zookeeper.apache.org/doc/trunk/recipes.html Patrick
