zk1931 / jzab

ZooKeeper Atomic Broadcast in Java
http://zk1931.github.io/jzab/master/
Apache License 2.0
54 stars 23 forks source link

combine clusterChange and leading/following callbacks? #134

Closed ghost closed 10 years ago

ghost commented 10 years ago

Right now we call clusterChange and leading/following callbacks separately. Maybe it's cleaner to combine these callbacks:

void following(String leader, Set<String> clusterMembers);
void leading(Set<String> activeFollowers, Set<String> clusterMEmbers);
EasonLiao commented 10 years ago

Sounds good! Also I think we need a callback like void exit(), I've added REMOVE request to zabkv, and I feel we need a way to tell the application it's removed. One way is once clusterChange callback is called we check the cluster members of new configuration, and if it's not included in cluster configuration, then it should exit. But I feel it's better to add a separate callback.

ghost commented 10 years ago

it seems a bit asymmetric to have removed() callback since we don't have joined() callback, but i could go either way.