سؤال

what is the difference between LeaderLatch and LeaderSelector in the apache curator framework?

http://curator.incubator.apache.org/curator-recipes/leader-election.html

هل كانت مفيدة؟

المحلول 2

LeaderLatch is simpler to use but LeaderSelector gives you more control. It depends on how much control you need.

Check out this presentation that I did and the gists that it links to for more details.

نصائح أخرى

They are different abstractions for the same behavior. LeaderSelector was written first (NOTE: I'm the main author of Curator). It uses a callback mechanism. Some Curator users wanted something that looked more like the JDK CountDownLatch, so I wrote LeaderLatch based on those requests. They both accomplish the same thing: leader election. Use whichever suits your needs.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top